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

Fixup of a fixup not working right

From
RDRobert Dailey <rcdailey.lists@gmail.com>
Date
Sep 2, 2016, 19:24 UTC
Message-ID
<CAHd499AQFDRps6POF2xuUjbYv5DJYxt3DA8aFFArXF=qQEz_CA@mail.gmail.com>

Suppose I have a branch with 4 commits, in the following order (as you might see during interactive rebase):

pick 123 Original Change pick 789 fixup! Original Change pick 456 Some Other Thing pick abc fixup! fixup! Original Change

However, let's say the first commit is already pushed upstream on a topic branch. Since there are multiple developers on this topic branch, I do not want to rebase right now. Instead, I want to document future fixups via fixup commits and then when we're ready to merge, do a final rebase prior to the merge to master to clean things up after we're all done collaborating.

For this specific situation, since the first commit is already pushed, I want to perform a fixup on the 1st fixup commit. When I perform an interactive rebase against upstream topic, I get the following:

pick 789 fixup! Original Change pick 456 Some Other Thing pick abc fixup! fixup! Original Change

The tip commit (abc in this case) is not marked as a fixup. What I expect to see is:

pick 789 fixup! Original Change fixup abc fixup! fixup! Original Change pick 456 Some Other Thing

Is this by design, or a defect? I assumed that Git would only look at the first occurrence of "fixup!" and treat everything else after as the commit description to match. But it seems in this case that it stops at the last occurrence of "fixup!", which would explain why it isn't matching in the interactive rebase. I haven't looked at the code, though.

Thoughts? Also I'm perfectly willing to accept feedback involving me just using the feature wrong or as not intended. Thanks in advance.

Next: Philip Oakley
Message 1 of 10 in “Fixup of a fixup not working right”
  1. Robert DaileySep 2, 2016
  2. Philip OakleySep 2, 2016
  3. Junio C HamanoSep 3, 2016
  4. Robert DaileySep 3, 2016
  5. Philip OakleySep 3, 2016
  6. Johannes SchindelinSep 4, 2016
  7. Philip OakleySep 4, 2016
  8. Johannes SchindelinSep 5, 2016
  9. Philip OakleySep 6, 2016
  10. Johannes SchindelinSep 7, 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.