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

Leveraging --rebase-merges --update-refs mechanism to rebase several branches in one run

From
YDYann Dirson <ydirson@free.fr>
Date
Jan 6, 2024, 19:05 UTC
Message-ID
<133456672.1820149400.1704567932308.JavaMail.root@zimbra39-e7>
In-Reply-To
<763603689.1820092086.1704566524953.JavaMail.root@zimbra39-e7>

This idea comes from a repo[1] where I am experimenting with code variants: on one side I have a branch where I add to the core mechanisms, and on the other(s) I have several branches where I experiment with different rendering options.

There are indeed 2 different workflows here:
- improving the variants themselves, where occasionally some fixup or new
  commit for the core branch gets introduced
- adding feature to the core branch, then merging that into each variant,
  where fixups already appear quite regularly

That produces a set closely-related branches with lots of merges, and applying the fixups is a bit tricky.

The "core + 1 variant" case pretty much works out of the box, with --rebase-merges and --update-refs generating a perfect instructions sheet.

But if I was to rebase just one variant while rewriting the core branch, obviously all other variants would still fork off the pre-rewrite core branch, and we'd loose all chances of automating the same work on the other variants.

OTOH, if I get `git-rebase` to generate the instruction sheets for those other variants first, strip them (manually) from the common part, and insert them in the instruction sheet of my "core + 1 variant" case ... I do get the whole of my branches rebased together, and sharing the updated core.

So the question is, would there be any obstacles to let git-rebase automate this completely? By chance it could even be a trivial change? I guess we'd only want this feature to be enabled under certain conditions, like --update-refs being specified so the many heads of the rebase would be reachable.

[1] https://github.com/ydirson/test-yew-tutorial/tree/opr is the "core" branch, and branches opr-* are the variants

Next: Johannes Sixt
Message 1 of 4 in “Leveraging --rebase-merges --update-refs mechanism to rebase several branches in one run”
  1. Yann DirsonJan 6, 2024
  2. Johannes SixtJan 7, 2024
  3. Yann DirsonJan 7, 2024
  4. Interactive rebase doc (Was: Leveraging --rebase-merges --update-refs mechanism to rebase several branches in one run)Yann Dirson, Jan 7, 2024

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.