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

Re: Possible bug in "git rebase" (non-interactive) with regards to post-rewrite

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 23, 2010, 00:02 UTC
Message-ID
<7vipyl4aqx.fsf@alter.siamese.dyndns.org>
In-Reply-To
<AANLkTikv+TuVK3uyEd5ymLRq6Qs7tQYm4kUH3t9hTtQP@mail.gmail.com>
Mihai Rusu <dizzy@google.com> writes:
Show 14 quoted lines
> I have found a possible bug in Git. When running "git rebase"
> (non-interactively, ie not "git rebase -i") on code that would
> conflict on the last commit that is being rebased and if that last
> commit is being skipped (git rebase --skip) then after the rebase is
> done the "post-rewrite" hook is not called by "git rebase". If I get a
> conflict and "git rebase --skip" any other commit or if I use "git
> rebase -i" and "git rebase --skip" the last commit when it conflicts
> then it calls post-rewrite just fine. Because this hook is normally
> called only once, at the end of a non-aborted rebase the fact that
> "git rebase" does not call it when the last commit conflicts and is
> skipped means the script is not called at all for that rebase
> operation thus breaking the code that depends on it.
>
> Please advise, thank you.
Perhaps this?  Totally untested...
 git-am.sh |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)
diff --git a/git-am.sh b/git-am.sh
index cf1f64b..6cdd591 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -577,13 +577,6 @@ then
 	resume=
 fi
 
-if test "$this" -gt "$last"
-then
-	say Nothing to do.
-	rm -fr "$dotest"
-	exit
-fi
-
 while test "$this" -le "$last"
 do
 	msgnum=`printf "%0${prec}d" $this`
Previous: Mihai RusuNext: Junio C Hamano
Message 2 of 4 in “Possible bug in "git rebase" (non-interactive) with regards to post-rewrite”
  1. Mihai RusuOct 18, 2010
  2. Junio C HamanoDec 23, 2010
  3. Junio C HamanoDec 23, 2010
  4. Thomas RastDec 26, 2010

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.