With CGit v0.8 supporting, atom feeds, patch targets and also the clone-url option, it’s time to finally rid ourselves of the memory hungry gitweb. Hence cgit.fd.o has been upgraded and gitweb been pointed to cgit.fd.o. There’s also a bucket load of redirects in place to support this. Hence all the old gitweb url’s should correctly translate into cgit urls.
Here’s the url redirect list in case someone else wants to use cgit over gitweb (highly recommended)
<VirtualHost *:80> ServerName gitweb2.freedesktop.org ServerAdmin sitewranglers@freedesktop.org CustomLog /var/log/apache2/gitweb.freedesktop.org-access.log combined ErrorLog /var/log/apache2/gitweb.freedesktop.org-error.log # # Redirects mapping gitweb -> cgit # # Gitweb uses get targets seperated by ; # # /?...;...;... # # p = Project # a = action ( blob, blob_plain, blobdiff, commitdiff, commit, shortlog, summary, tree, log, tag, history, rss) # h = SHA Hash # o = sort order # hb= SHA Hash Tree Base # hp= ? # pg= page # f= file/dir # # Cgit uses the following: # # /project/action/?... # # action ( commit, log, diff, tree, tag, patch ) # # id = SHA Hash # id2 = SHA Hash # h = head # # Translation rules # # Project is a straight redirect # --- # /?p=([^.]+).git; http://cgit.freedesktop.org/$1/ # # Action requires a mapping # --- # a=(blob|tree) /tree/ # a=(blobdiff|commitdiff) /diff/ # a=commit /commit/ # a=(summary) / # a=(shortlog|log|history) /log/ # a=tag /tag/ # a=blob_plain /blob/ # a=rss ?No CGIT Equivilant? # # Targets require mapping # --- # h=([^;]+) id=$1 # f=([^;]+) /$1 # hb=([^;]+) id2=$1 # hp([^;]+ id=$1 # # Now putting it all together # RewriteEngine On #RewriteLog /tmp/rewrite.log #RewriteLogLevel 5 RewriteCond %{query_string} p=([^.]+)(\.git)*;a=blob;h=([^;]+);hb=([^;]+);f=([^;]+) RewriteRule ^/$ http://cgit.freedesktop.org/%1/tree/%5?id=%3;id2=%4 [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=blob;hb=([^;]+);f=([^;]+) RewriteRule ^/$ http://cgit.freedesktop.org/%1/tree/%4?id=%3 [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=tree;h=([^;]+);hb=([^;]+);f=([^;]+) RewriteRule ^/$ http://cgit.freedesktop.org/%1/tree/%5?id=%4 [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=tree;h=([^;]+);hb=([^;]+) RewriteRule ^/$ http://cgit.freedesktop.org/%1/tree/?id=%4 [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=tree;hb=([^;]+) RewriteRule ^/$ http://cgit.freedesktop.org/%1/tree/?id=%3 [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=tree RewriteRule ^/$ http://cgit.freedesktop.org/%1/tree/? [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=blobdiff;h=([^;]+);hp=([^;]+);hb=([^;]+);f=([^;]+) RewriteRule ^/$ http://cgit.freedesktop.org/%1/diff/%6?id2=%4;id=%3;id3=%5 [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=commitdiff;h=([^;]+);hp=([^;]+) RewriteRule ^/$ http://cgit.freedesktop.org/%1/diff/?id=%4;id2=%3 [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=commitdiff;h=([^;]+) RewriteRule ^/$ http://cgit.freedesktop.org/%1/diff/?id=%3 [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=commit;h=([^;]+) RewriteRule ^/$ http://cgit.freedesktop.org/%1/commit/?id=%3 [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=shortlog;h=([^;]+) RewriteRule ^/$ http://cgit.freedesktop.org/%1/log/?id=%3 [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=shortlog RewriteRule ^/$ http://cgit.freedesktop.org/%1/log/? [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=log;h=([^;]+) RewriteRule ^/$ http://cgit.freedesktop.org/%1/log/?id=%3 [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=log RewriteRule ^/$ http://cgit.freedesktop.org/%1/log? [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=history;h=([^;]+);hb=([^;]+);f=([^;]+) RewriteRule ^/$ http://cgit.freedesktop.org/%1/log/%5?id=%4 [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=history;h=([^;]+);hb=([^;]+) RewriteRule ^/$ http://cgit.freedesktop.org/%1/log/?id=%4 [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=history;hb=([^;]+);f=([^;]+) RewriteRule ^/$ http://cgit.freedesktop.org/%1/log/%4?id=%3 [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=history;hb=([^;]+) RewriteRule ^/$ http://cgit.freedesktop.org/%1/log/?id=%3 [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=tag;h=([^;]+) RewriteRule ^/$ http://cgit.freedesktop.org/%1/tag/?id=%4 [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=blob_plain;h=([^;]+);f=([^;]+) RewriteRule ^/$ http://cgit.freedesktop.org/%1/blob/%4?id=%3 [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=blob_plain;f=([^;]+) RewriteRule ^/$ http://cgit.freedesktop.org/%1/blob/%4 [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=rss RewriteRule ^/$ http://cgit.freedesktop.org/%1/atom? [R,L,NE] RewriteCond %{query_string} p=([^.]+)(\.git)*;a=summary RewriteRule ^/$ http://cgit.freedesktop.org/%1/? [R,L,NE] # # Fail safes incase nothing above matches, try at least to put the person in the project, els root of cgit RewriteCond %{query_string} p=([^.]+)(\.git)*.* RewriteRule ^/$ http://cgit.freedesktop.org/%1/? [R,L,NE] RewriteRule ^.* http://cgit.freedesktop.org/ [R,L,NE] </VirtualHost>