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

Re: [PATCH v1 3/3] doc: rebase: clarify fixup! fixup! constraint

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 14, 2016, 22:20 UTC
Message-ID
<xmqqvaz3j8ln.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160814214630.1312-4-philipoakley@iee.org>
Philip Oakley <philipoakley@iee.org> writes:
> 22c5b13 (rebase -i: handle fixup! fixup! in --autosquash, 2013-06-27)
That's a noun that names a commit object.  What about it?
> I certainly misunderstood what this meant. It sounded like only one fixup! was
> allowed per commit (i.e. one mistake) - fixing two mistakes wouldn't be
> allowed. Hindsight is a wonderful thing.
I think this is about
	git commit -m foo
	... some other commits
        git commit -m 'fixup! foo'
	... even more other commits
        git commit -m 'fixup! fixup! foo'

The last one is technically a fixup of the second one, but as long as the second one is to be applied _and_ the last one comes after the second one, we could say that both of them are fix-ups for the very first one. And that is what the original text says.

I have a feeling that if the editor session to edit the todo drops the second one and leaves this:

	pick foo
        fixup fixup! fixup! foo

the command _should_ notice that the second one that is required to apply the last one is gone and error out, but probably the code does not do so, and if that is the case, I think "they fix the very first commit that invited these fixups" is a more reasonable description than the more technically stringent "fixup! fixup! is to fix what the fixup! did", which is not what the code implements.

> Also, does 'earliest commit requiring fixup/squash' fully convey that
> its the one to fix.
I cannot tell if that a question or a statement?
Show 21 quoted lines
> ---
>  Documentation/git-rebase.txt | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
> index 66b789a..91eb107 100644
> --- a/Documentation/git-rebase.txt
> +++ b/Documentation/git-rebase.txt
> @@ -425,9 +425,9 @@ without an explicit `--interactive`.
>  	automatically modify the todo list of rebase -i
>  	so that the commit marked for squashing comes right after the
>  	commit to be modified, and change the action of the moved
> -	commit from `pick` to `squash` (or `fixup`).  Ignores subsequent
> -	"fixup! " or "squash! " after the first, in case you referred to an
> -	earlier fixup/squash with `git commit --fixup/--squash`.
> +	commit from `pick` to `squash` (or `fixup`).  Commits with repeated
> +	"fixup! " or "squash! " in the subject line are considered to refer
> +	to the earliest commit requiring fixup/squash.
>  +
>  This option is only valid when the '--interactive' option is used.
>  +
Previous: Philip OakleyNext: Philip Oakley
Message 9 of 16 in “fixup fixup documenation”
  1. 0/3 fixup fixup documenationPhilip Oakley, Aug 14, 2016
  2. 1/3 doc: commit: --fixup/--squash can take a commit revisionPhilip Oakley, Aug 14, 2016
  3. Junio C HamanoAug 14, 2016
  4. Philip OakleyAug 14, 2016
  5. Junio C HamanoAug 14, 2016
  6. Philip OakleyAug 14, 2016
  7. Philip OakleyAug 16, 2016
  8. 3/3 doc: rebase: clarify fixup! fixup! constraintPhilip Oakley, Aug 14, 2016
  9. Junio C HamanoAug 14, 2016
  10. Philip OakleyAug 14, 2016
  11. Junio C HamanoAug 15, 2016
  12. 2/3 doc: rebase: fixup! can take an object namePhilip Oakley, Aug 14, 2016
  13. Junio C HamanoAug 14, 2016
  14. Philip OakleyAug 14, 2016
  15. Junio C HamanoAug 14, 2016
  16. Philip OakleyAug 14, 2016

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.