git – Moy Blog https://moythreads.com/wordpress Abandon All Hope, Ye Who Read This Blog Mon, 15 Feb 2021 22:51:26 +0000 en-US hourly 1 https://wordpress.org/?v=5.1.9 GitHub Rejects Multiple-Authors Commits https://moythreads.com/wordpress/2014/07/22/github-and-multiple-authors-commits/ https://moythreads.com/wordpress/2014/07/22/github-and-multiple-authors-commits/#comments Tue, 22 Jul 2014 07:21:19 +0000 http://www.moythreads.com/wordpress/?p=260 Continue reading ]]> 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 '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.

]]>
https://moythreads.com/wordpress/2014/07/22/github-and-multiple-authors-commits/feed/ 2
GIT hooks https://moythreads.com/wordpress/2011/04/11/git-hooks/ https://moythreads.com/wordpress/2011/04/11/git-hooks/#respond Mon, 11 Apr 2011 22:57:52 +0000 http://www.moythreads.com/wordpress/?p=145 Continue reading ]]> I started using git hooks to update a clone repository with git pull just after every push to the repository. It was a bit of a pain to get it to work. The hook kept complaining about “fatal: Not a git repository: ‘.'”

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 🙁

]]>
https://moythreads.com/wordpress/2011/04/11/git-hooks/feed/ 0