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

Re: [PATCH 2/2] git-rebase--interactive: auto amend only edited commit

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Sep 9, 2008, 06:42 UTC
Message-ID
<48C61AF1.1060703@viscovery.net>
In-Reply-To
<1220906569-26878-2-git-send-email-dpotapov@gmail.com>
Dmitry Potapov schrieb:
Show 8 quoted lines
> Another problem is that after being stopped at "edit", the user adds new
> commits. In this case, automatic amend behavior of git rebase triggered
> by some stage changes causes that not only that the log message of the
> last commit is lost but that it will contain also wrong Author and Date
> information.
> 
> Therefore, this patch restrict automatic amend only to the situation
> where HEAD is the commit at which git rebase stop by "edit" command.
...
Show 6 quoted lines
> @@ -430,6 +430,8 @@ do
>  			if test -f "$DOTEST"/amend
>  			then
>  				amend=$(git rev-parse --verify HEAD)
> +				test "$amend" = $(cat "$DOTEST"/amend) ||
> +				die "You have uncommitted changes"

Doesn't this terse message carry a bit of a "WTF?" factor? In other situations rebase --continue goes into git-commit just fine, but it does not under these special conditions. How about this:

"Will not auto-commit uncommitted changes after you have already committed something. Please run 'git commit --amend' yourself."

>  				git reset --soft HEAD^ ||
>  				die "Cannot rewind the HEAD"
>  			fi
-- Hannes
Previous: Dmitry PotapovNext: Dmitry Potapov
Message 6 of 12 in “git-rebase-interactive: do not squash commits on abort”
  1. 1/2 git-rebase-interactive: do not squash commits on abortDmitry Potapov, Sep 8, 2008
  2. 2/2 git-rebase--interactive: auto amend only edited commitDmitry Potapov, Sep 8, 2008
  3. Junio C HamanoSep 9, 2008
  4. Dmitry PotapovSep 9, 2008
  5. git-rebase--interactive: auto amend only edited commitDmitry Potapov, Sep 9, 2008
  6. Johannes SixtSep 9, 2008
  7. Dmitry PotapovSep 9, 2008
  8. Junio C HamanoSep 9, 2008
  9. Johannes SchindelinSep 9, 2008
  10. git-rebase-interactive: do not squash commits on abortDmitry Potapov, Sep 9, 2008
  11. Johannes SchindelinSep 10, 2008
  12. Junio C HamanoSep 10, 2008

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.