Re: Some index-base bug in "next" branch ("git-applymbox"-related?)..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> 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 <junkio@xxxxxxx>
---
 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='<msg> <patch> <info> [<signoff>]'
 . 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


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]