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

Re: [PATCH v7 3/3] replay: offer an option to linearize the commit topology

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 15, 2026, 18:49 UTC
Message-ID
<xmqqse5km6lc.fsf@gitster.g>
In-Reply-To
<CABPp-BGxO0bd3UzDYNnhNUgDSKYwcFVCFsJ9rCzmNX7Q0xBrow@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
Show 6 quoted lines
> You're right that when flattening merges within a single branch, the
> machinery must pick an order, and that's fine — unavoidable, even.  My
> objection isn't that; it's primarily the concatenation of distinct
> branches named on the command line into one chain, and, as a secondary
> point, the ignoring of the order of branches explicitly specified by
> the user on the command line.

That is true, but a user who wishes to avoid flattening in an unspecified order can always choose to supply only one branch at a time on the command line.

Show 5 quoted lines
> Concretely: I have three branches to rebase onto master; one of them
> happens to contain a merge I'd like flattened. I add  --linearize  for
> that one merge — and now all three branches are silently concatenated
> into a single chain.  That makes no sense to me, and I think won't to
> most users.

But if that is not the outcome they wanted, I fail to see why they would feed all three branches to a single invocation of --linearize in the first place. After all, the command is only doing what it was asked to do.

Show 25 quoted lines
> Consider the following history
>
> M1  M2  M3  M4  M5
> *---*---*---*---* <- master
>     \   \
>      \   \  A1  A2  A3  A4
>       \   \-*---*---*---* <- branchA
>        \        \
>         \        -*---* <- branchC
>          \        C1  C2
>           \
>            \-*---*---* <- branchB
>             B1  B2  B3
>
> git replay was designed to allow you to update all your branches at once.
> For example, with this above history, running
>     git replay --onto master branchA branchB branchC
> will rebase all three branches onto master (and handles the shared portion
> of history between branchA and branchC in the obvious way):
> ...
> M1  M2  M3  M4  M5  B1  B2  B3  A1  A2  C1  C2  A3  A4
> *---*---*---*---*---*---*---*---*---*---*---*---*---*
>                 ^           ^               ^       ^
>                 |           |               |       |
>               master     branchB         branchC  branchA

If that is not what you want, why did you give all three to the single invocation? If you want A's and B's all consecutive, linearlize branchA on top of 'master', and brnachB on top of it, and branch C on top, perhaps?

If that breaks because by the time you feed branchC to the machinery nobody remembers that A1 and A2 were already handled, _that_ is the problem the command needs to solve, no? I am confused.

Or do you want to be able to tell "linearlize B, A, and C in this turn on top of 'master'" and M1..M5..B1'..B3'..A1'..A4'..C1'..C2' as the result? That would mean the command line syntax cannot be an arbitrary rev list range, but limited to a single negative plus one or more positive revision, which may be very limited but is much less error prone for casual users.

Previous: Elijah NewrenNext: Elijah Newren
Message 58 of 75 in “Teach git-replay(1) to linearize merge commits”
  1. 0/3 Teach git-replay(1) to linearize merge commitsToon Claes, Jun 8, 2026
  2. 1/3 replay: refactor enum replay_mode into a boolToon Claes, Jun 8, 2026
  3. 2/3 replay: add helper to put entry into mapped_commitsToon Claes, Jun 8, 2026
  4. 3/3 replay: offer an option to linearize the commit topologyToon Claes, Jun 8, 2026
  5. Junio C HamanoJun 8, 2026
  6. Toon ClaesJun 10, 2026
  7. 0/3 Teach git-replay(1) to linearize merge commitsToon Claes, Jun 10, 2026
  8. 1/3 replay: refactor enum replay_mode into a boolToon Claes, Jun 10, 2026
  9. Justin ToblerJun 11, 2026
  10. Toon ClaesJun 12, 2026
  11. 2/3 replay: add helper to put entry into mapped_commitsToon Claes, Jun 10, 2026
  12. 3/3 replay: offer an option to linearize the commit topologyToon Claes, Jun 10, 2026
  13. Junio C HamanoJun 10, 2026
  14. Toon ClaesJun 16, 2026
  15. Elijah NewrenJun 14, 2026
  16. Toon ClaesJun 16, 2026
  17. 0/3 Teach git-replay(1) to linearize merge commitsToon Claes, Jun 16, 2026
  18. 1/3 replay: refactor enum replay_mode into a boolToon Claes, Jun 16, 2026
  19. 2/3 replay: add helper to put entry into mapped_commitsToon Claes, Jun 16, 2026
  20. 3/3 replay: offer an option to linearize the commit topologyToon Claes, Jun 16, 2026
  21. 0/3 Teach git-replay(1) to linearize merge commitsToon Claes, Jun 22, 2026
  22. 1/3 replay: refactor enum replay_mode into a boolToon Claes, Jun 22, 2026
  23. Patrick SteinhardtJun 22, 2026
  24. Junio C HamanoJun 22, 2026
  25. Toon ClaesJun 24, 2026
  26. 2/3 replay: add helper to put entry into mapped_commitsToon Claes, Jun 22, 2026
  27. Patrick SteinhardtJun 22, 2026
  28. 3/3 replay: offer an option to linearize the commit topologyToon Claes, Jun 22, 2026
  29. Patrick SteinhardtJun 22, 2026
  30. Toon ClaesJun 26, 2026
  31. Patrick SteinhardtJun 29, 2026
  32. Johannes SchindelinJun 30, 2026
  33. Patrick SteinhardtJun 30, 2026
  34. 0/3 Teach git-replay(1) to linearize merge commitsToon Claes, Jun 26, 2026
  35. 1/3 replay: add helper to put entry into mapped_commitsToon Claes, Jun 26, 2026
  36. Junio C HamanoJun 26, 2026
  37. 2/3 replay: better explain how pick_regular_commit() picks a baseToon Claes, Jun 26, 2026
  38. 3/3 replay: offer an option to linearize the commit topologyToon Claes, Jun 26, 2026
  39. Junio C HamanoJun 26, 2026
  40. Phillip WoodJun 27, 2026
  41. Toon ClaesJul 1, 2026
  42. Johannes SchindelinJun 28, 2026
  43. Toon ClaesJun 30, 2026
  44. 0/3 Teach git-replay(1) to linearize merge commitsToon Claes, Jul 2, 2026
  45. 1/3 replay: add helper to put entry into replayed_commitsToon Claes, Jul 2, 2026
  46. 2/3 replay: resolve the replay base outside pick_regular_commit()Toon Claes, Jul 2, 2026
  47. 3/3 replay: offer an option to linearize the commit topologyToon Claes, Jul 2, 2026
  48. Junio C HamanoJul 3, 2026
  49. Toon ClaesJul 7, 2026
  50. Junio C HamanoJul 7, 2026
  51. 0/3 Teach git-replay(1) to linearize merge commitsToon Claes, Jul 7, 2026
  52. 1/3 replay: add helper to put entry into replayed_commitsToon Claes, Jul 7, 2026
  53. 2/3 replay: resolve the replay base outside pick_regular_commit()Toon Claes, Jul 7, 2026
  54. 3/3 replay: offer an option to linearize the commit topologyToon Claes, Jul 7, 2026
  55. Elijah NewrenJul 10, 2026
  56. Junio C HamanoJul 13, 2026
  57. Elijah NewrenJul 15, 2026
  58. Junio C HamanoJul 15, 2026
  59. Elijah NewrenJul 16, 2026
  60. Junio C HamanoJul 17, 2026
  61. Toon ClaesJul 27, 2026
  62. Junio C HamanoJul 8, 2026
  63. 0/3 Teach git-replay(1) to linearize merge commitsToon Claes, Jul 28, 2026
  64. 1/3 replay: add helper to put entry into replayed_commitsToon Claes, Jul 28, 2026
  65. 2/3 replay: resolve the replay base outside pick_regular_commit()Toon Claes, Jul 28, 2026
  66. 3/3 replay: offer an option to linearize the commit topologyToon Claes, Jul 28, 2026
  67. Justin ToblerAug 7, 2026
  68. Elijah NewrenAug 8, 2026
  69. Toon ClaesAug 31, 2026
  70. Junio C HamanoJul 28, 2026
  71. 0/3 Teach git-replay(1) to linearize merge commitsToon Claes, Aug 31, 2026
  72. 1/3 replay: add helper to put entry into replayed_commitsToon Claes, Aug 31, 2026
  73. 2/3 replay: resolve the replay base outside pick_regular_commit()Toon Claes, Aug 31, 2026
  74. 3/3 replay: offer an option to linearize the commit topologyToon Claes, Aug 31, 2026
  75. Elijah NewrenSep 1, 2026

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.