I'm trying to programmatically map gitweb-format query strings to cgit query strings to transition fully to cgit without breaking old gitweb-based urls pointing to my repositories which are scattered here and there around the web. I've seen some regex-based URL rewriting rules such as the following:
http://www.clearchain.com/blog/posts/cgit-upgrade-gitweb-retired
but I'm trying to actually understand the variables in the query string to make sure I get it right, and I'll be using a tiny CGI program rather than mod_rewrite or whatever do to the remapping. In particular, I don't understand the semantics of the h
, hb
, and hp
hashes and how they map to cgit's id
query variables for different types of queries.
Can anyone familiar with them fill me in or point me to a good resource?
Basically
id
comes fromhashb
if the gitweb url useshashb
, otherwise fromhash
.id2
comes from hashpbif the gitweb url uses
hashpb, otherwise from
hashp`.Here's the script I'm using now (no external commands invoked if your shell doesn't suck):