commit 1361d5cf632b494f8e1ee6d242c72148fcb44d8b Author: David Fifield david@bamsoftware.com Date: Sat Dec 14 00:16:50 2013 +0000
Update the index in preparation for applying patches.
Using "git am" to apply a patch was failing randomly using git version 1.7.0.4 on the lucid i386 and amd64 images. The error message was:
ubuntu@ubuntu:~/build/tor$ git am ~/build/0001-Set-CREATE_NO_WINDOW-in-tor_spawn_background.patch Applying: Set CREATE_NO_WINDOW in tor_spawn_background. error: src/common/util.c: does not match index Patch failed at 0001 Set CREATE_NO_WINDOW in tor_spawn_background. When you have resolved this problem run "git am --resolved". If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort".
I could log in and run the command manually; it would fail perhaps 10% of the time. The rest of the time it would work as expected. What I mean is that I could set the working tree to the tag tor-0.2.4.18-rc using either of git checkout tor-0.2.4.18-rc git reset --hard tor-0.2.4.18-rc try running the "git am" command, and sometimes it would work, sometimes not. I would reset the state of the tree and again, sometimes it would work, and sometimes not. I checked many times using "git status" and "git ls-files -s" to see that there were no changes and nothing staged in the working tree.
I believe the cause of the error is the bug fixed by this commit: "am: refresh the index at start and --resolved" https://github.com/git/git/commit/2a6f08ac1f6949ed0072aed3240bc04d80051851 It doesn't seem to have made it into the release notes, but according to the history it first appeared in 1.7.6.1.
See also the email thread leading to the commit: http://git.661346.n2.nabble.com/quot-git-apply-check-quot-successes-but-git-...
I never got this error with "git am" for the windows build on the precise i386 VM, which has git version 1.7.9.5, which fits with the problem being a git bug that has since been fixed. --- gitian/descriptors/linux/gitian-tor.yml | 1 + gitian/descriptors/mac/gitian-tor.yml | 1 + gitian/descriptors/windows/gitian-tor.yml | 1 + 3 files changed, 3 insertions(+)
diff --git a/gitian/descriptors/linux/gitian-tor.yml b/gitian/descriptors/linux/gitian-tor.yml index df92f37..4181a38 100644 --- a/gitian/descriptors/linux/gitian-tor.yml +++ b/gitian/descriptors/linux/gitian-tor.yml @@ -68,6 +68,7 @@ script: | chmod 700 $INSTDIR/Tor/*so* # cd tor + git update-index --refresh -q mkdir -p $OUTDIR/src #git archive HEAD | tar -x -C $OUTDIR/src ./autogen.sh diff --git a/gitian/descriptors/mac/gitian-tor.yml b/gitian/descriptors/mac/gitian-tor.yml index c0b483b..6a14980 100644 --- a/gitian/descriptors/mac/gitian-tor.yml +++ b/gitian/descriptors/mac/gitian-tor.yml @@ -84,6 +84,7 @@ script: | cd .. # cd tor + git update-index --refresh -q mkdir -p $OUTDIR/src git archive HEAD | tar -x -C $OUTDIR/src ./autogen.sh diff --git a/gitian/descriptors/windows/gitian-tor.yml b/gitian/descriptors/windows/gitian-tor.yml index 836e695..1d7ea7c 100644 --- a/gitian/descriptors/windows/gitian-tor.yml +++ b/gitian/descriptors/windows/gitian-tor.yml @@ -80,6 +80,7 @@ script: | cd .. # cd tor + git update-index --refresh -q mkdir -p $OUTDIR/src git archive HEAD | tar -x -C $OUTDIR/src ./autogen.sh