I am a fan of GitHub and that made it even more shocking for me when I found out that it seems GitHub has problems accepting git commits with multiple authors in it.
Have a look at this commit from the FreeSWITCH repository: https://stash.freeswitch.org/projects/FS/repos/freeswitch/commits/487128950df6ee433c131b5feaafe81ee86629f4
The commit looks pretty harmless in itself, but using git cat-file or git show you can see that there are 2 authors:
moy@sigchld test_clone (test_clone) $ git cat-file -p 487128950df6ee433c131b5feaafe81ee86629f4 tree 070633dfc3ea352dfb1094822f477111e519a9ca parent cde20f6fe68523d9416d2fed72435a8ba880a269 author Travis Cross1395382322 +0000 author Anthony Minessale 1394747953 +0500 committer Travis Cross 1395665690 +0000 Use the system version of APR / APR-util if possible Autodetect whether the system libapr / libaprutil has our necessary modifications and use it if it does.
And surprisingly, GitHub barfs when pushing a branch that contains that commit:
moy@sigchld test_clone-2.0.2 (test_branch) $ git push moy test_branch Counting objects: 14905, done. Delta compression using up to 8 threads. Compressing objects: 100% (3345/3345), done. remote: error: object 487128950df6ee433c131b5feaafe81ee86629f4:invalid format - expected 'committer' line remote: fatal: Error in object error: pack-objects died of signal 13 error: failed to push some refs to 'git@github.com:moises-silva/freeswitch.git'
Every other git server I’ve tried (gitlab, gitolite, stash) accepts the commit. It would seem GitHub has some sort of hook that is not expecting two author lines one after the other and it’s expecting a “committer” instead right after the first author.
I’ve sent a support note to GitHub, hopefully they’ll fix this one.
]]>I was clearly able to switch to the correct directory with cd /path/to/repo && git pull, but it kept failing.
It seems git hooks run with some git environment variables like GIT_DIR that affect the new instance of git being spawned. The easiest solution I found was to specify –git-dir when doing the pull:
cd /path/to/repo
git --git-dir=/path/to/repo/.git pull
And finally I could move on after being stuck like half an hour