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

Subsystems: the rest

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:04

Linus Torvalds [off-list ref] 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 <redacted>
---
 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

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

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:43:04


On Thu, 12 Apr 2007, Junio C Hamano wrote:
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.
Hey, I'd happily use git-am too..

If you want to deprecare git-applymbox, why don't you just make it an 
alias for git-am, potentially doing the defaults and command line argument 
conversion?

I certainly don't care about the *implementation* details. As long as my 
mailbox applicator continues to work ;)

			Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help