I have set up gitlist + apache + basic auth + git-http-backend, and both web display and git clone of git repository are working fine.
However, for the committed code, I want to use the username during apache authentication for the author name (or committer name).
The reason is, sometimes the engineers would do ad-hoc patching on the testing servers directly, and push the code back to git after the patch is finalized. Hence, now all patches shared the same author name, which is difficult for checking (or blame).
Any advice about this please? thanks a lot.
When I do modifications on the server directly, I wrap
gitin a custom script (wgit) which forces the user to choose an alias like:That mean a
git xxxwill actually call:If
wgit(default alias forgit) is used alone, an error message is displayed:The two first parameters defines a username and email which will be reused to modify the Git environment variables:
That allows me to add to the prompt a message displaying at all time (for any for any git command) who you are:
If you really need to bypass that authentication part, you can add an
xxgitvariable in front of yourgitcommand:That
git ...command will work even if you didn't pick an alias to identify yourself.