UPDATE: GitHub replied to my inquiry (that was fast!). It appears the FreeSWITCH repository has some corrupted commits. The command “git fsck” indicates an error as well with a couple of commits with multiple authors. GitHub seems to be performing (rightly so) verification on push.
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 Cross
1395382322 +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 'email@example.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.
Thanks for the clarification Michael, that’s exactly what I learned after digging further into this and seeing the response from github
Git itself doesn’t allow commits with multiple authors, as you will see if you run `git fsck` on your repository:
$ git fsck
Checking object directories: 100% (256/256), done.
error in commit 487128950df6ee433c131b5feaafe81ee86629f4: invalid format – expected ‘committer’ line
error in commit 8574988c3a378b4d5861ecaeb0e958657635703b: invalid format – expected ‘committer’ line
Checking objects: 100% (251031/251031), done.
It might be that some Git commands accidentally work with these invalid commits, but others will fail. For example, if you rebase that commit, the second author will be lost.
So I think this is a case of GitHub doing consistency checks on what is pushed, whereas the other sites don’t.