Re: [PATCH v2 01/10] technical doc: add a design doc for the evolve command
- From
Victoria Dye <vdye@github.com>
- Date
- Oct 11, 2022, 16:59 UTC
- Message-ID
- <0c7a87bc-f2b7-4c9e-cfe5-b4ba6b33fee7@github.com>
- In-Reply-To
- <3384d8ab-ddbb-6e57-1663-d039fc99e0a6@dunelm.org.uk>
Phillip Wood wrote:
Show 20 quoted lines
> On 10/10/2022 20:35, Victoria Dye wrote: >> Stefan Xenos via GitGitGadget wrote: >> 3. Can't handle multiple changes sharing the same parent when the parent >> needs to be rebased >> - Since the introduction of '--update-refs' [1], this is technically >> possible (although it needs a UI for the use case you mentioned). > > '--update-refs' is more limited though I think. With evolve if I have > > D (topic-2) > / > A - B - C (topic-1) > \ > E (topic-3) > > then if I checkout topic-1 and amend one of the commits I can run "git > evolve" to automatically rebase topic-2 & topic-3. One cannot do that with > "rebase --update-refs". We could extend rebase (or have a new command) so > that users can say "amend commit X and rebase all the branches that contain > it".
Sorry, let me clarify what I mean. The 'update-ref' command in a 'rebase-todo' script (not the '--update-refs' option) can be used to create a rebase script that does what's described in your example:
label onto # A
reset onto pick 1342ab B fixup 8a7f3e fixup! B label branch-point-1
pick 90d7fc C label topic-1 update-ref refs/heads/topic-1
reset branch-point-1 pick 42f92b D label topic-2 update-ref refs/heads/topic-2
reset branch-point-1 pick 06d8ec E label topic-3 update-ref refs/heads/topic-3
So, while it'd need a less manual UI (e.g., a 'rebase --evolve' option) to generate that script, the 'update-ref' command makes this functionality possible in a rebase.