git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <junkio@cox.net>
Date
Apr 13, 2007, 00:22 UTC
Message-ID
<7vbqhti0nr.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0704121533560.4061@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 8 quoted lines
> 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@cox.net>
---
 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
Previous: Junio C HamanoNext: Linus Torvalds
Message 3 of 15 in “Some index-base bug in "next" branch ("git-applymbox"-related?)..”
  1. Linus TorvaldsApr 12, 2007
  2. Junio C HamanoApr 12, 2007
  3. Junio C HamanoApr 13, 2007
  4. Linus TorvaldsApr 13, 2007
  5. Junio C HamanoApr 13, 2007
  6. Linus TorvaldsApr 13, 2007
  7. Junio C HamanoApr 13, 2007
  8. Reverting the whole index-base seriesJunio C Hamano, Apr 15, 2007
  9. Linus TorvaldsApr 15, 2007
  10. Junio C HamanoApr 15, 2007
  11. Linus TorvaldsApr 15, 2007
  12. Junio C HamanoApr 15, 2007
  13. Linus TorvaldsApr 15, 2007
  14. Junio C HamanoApr 16, 2007
  15. Linus TorvaldsApr 16, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.