Skip to contentSkip to conversation

Add the Git Change command

PATCH Superseded Christophe Poucet via GitGitGadget 10 participants 66 messages Sep 23, 2022 – Oct 12, 2022 Page 2 of 2

Subsystems (2)
lore
Share & tools
lore
#55 lore raw

Re: [PATCH v2 01/10] technical doc: add a design doc for the evolve command

In reply to Victoria Dye

Hi Victoria

Quoted 42 lines · Victoria Dye
Quoted 15 lines · Phillip Wood
Quoted 5 lines · Victoria Dye

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)

Quoted 5 lines

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

Quoted 8 lines

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.

Ah, I'd misunderstood what you meant, that makes sense - thanks for clarifying.

Best Wishes

Phillip