From: Junio C Hamano Date: Fri, 13 Apr 2007 00:22:00 GMT Subject: Re: Some index-base bug in "next" branch ("git-applymbox"-related?).. Message-ID: <7vbqhti0nr.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Linus Torvalds writes: > That "80584ff.." commit is the commit *before* the "dotest", and HEAD is > (correctly) 6a04de.. that is the end result of the "dotest". That "dotest" > thing is just because "git-applymbox" isn't in my brain stem: > > [torvalds@woody linux]$ alias dotest > alias dotest='git-applymbox -u' > > so it's not actually anything strange. This will teach applymbox the index base safety, but it shows that the division between applymbox and applypatch makes things less efficient than how git-am can do the same. In 5ddb93e that teaches the same to git-am, we need to deal with the index base only once at the beginning to check and once at the end to update. applypatch being a separate program means we cannot do that easily inside applymbox. -- >8 -- [PATCH] Teach applypatch about the index base Signed-off-by: Junio C Hamano --- git-applypatch.sh | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/git-applypatch.sh b/git-applypatch.sh index 8df2aee..c6d88e4 100755 --- a/git-applypatch.sh +++ b/git-applypatch.sh @@ -14,6 +14,8 @@ USAGE=' []' . git-sh-setup +check_base || exit + case "$#" in 3|4) ;; *) usage ;; esac final=.dotest/final-commit @@ -205,6 +207,7 @@ parent=$(git-rev-parse --verify HEAD) && commit=$(git-commit-tree $tree -p $parent <"$final") || exit 1 echo Committed: $commit git-update-ref -m "applypatch: $SUBJECT" HEAD $commit $parent || exit +git update-index --set-base "$commit" if test -x "$GIT_DIR"/hooks/post-applypatch then -- 1.5.1.1.772.gab9f7