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

Re: A couple of rebase --autosquash proposals

From
PVPhilippe Vaucher <philippe.vaucher@gmail.com>
Date
Dec 9, 2013, 09:39 UTC
Message-ID
<CAGK7Mr75jPCWWRDE9ohLXaxk-JuRosf8960KfJ0HknaAVq-qXg@mail.gmail.com>
In-Reply-To
<52A58CBB.6040809@gmail.com>
Show 23 quoted lines
> >> * fixup! or squash! on it's own would default to fixing-up the
> >> previous commit (or result of previous step of rebase if that was a
> >> squash/fixup).
> >
> > Why would you want that? To fixup the previous commit, just use 'git
> > commit --amend'. What am I missing?
>
> In the past I've used this kind of approach when doing merging/porting
> work with 3rd party code (or just large integrations). The first (and
> eventually final) commit introduces the new code. The subsequent fixups
> address build issues which are either errors in the 3rd party code
> (which I will want to submit bug reports for later and carry in my tree
> as real commits) or errors in my merging (which I want to squash into
> the merge commit). When faced with a screen full of compilation errors
> I'm not sure which of these 2 categories are applicable at the time so I
> tend to have lots of little fixups that I need to juggle around with git
> rebase once I've got the code compiling and passing some tests.
>
> All that being said I think allowing multiple "fixup!\n" stack up on
> each other might be a bit dangerous. There are cases where
> fixup!-fixup!-real might be useful but those would be hard to
> distinguish those from cases where someone absent mindedly forgot to put
> something after "fixup!".

You guys probably already know about it, but there is `git commit --fixup SHA1` to create !fixup commits intended for a particular commit. I think using this feature solves all the problem the OP has?

Philippe
Previous: Chris PackhamNext: Brett Randall
Message 4 of 7 in “A couple of rebase --autosquash proposals”
  1. Brett RandallDec 9, 2013
  2. Johannes SixtDec 9, 2013
  3. Chris PackhamDec 9, 2013
  4. Philippe VaucherDec 9, 2013
  5. Brett RandallDec 9, 2013
  6. Junio C HamanoDec 9, 2013
  7. Brett RandallDec 9, 2013

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.