Re: [PATCH 0/4] rebase: update branches in multi-part topic
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 3, 2022, 18:52 UTC
- Message-ID
- <xmqqr145fuku.fsf@gitster.g>
- In-Reply-To
- <YppSl4rOvVciLuXE@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
Show 8 quoted lines
> But I wonder if we can or should delay these update-refs as long as > possible. In particular: what happens if I get past this "exec" line (so > that I've already updated my bundle-redo/fetch branch to point at the > new thing), but decide at some later point to abort the rebase? > > I think users will expect us to restore bundle-redo/fetch to where it > was before if we end up in that case. Recovering from it manually sounds > like kind of a headache.
That is a very good safety and usability concern. I am glad somebody thought of it.
Show 12 quoted lines
> What if instead we created labels here, and then delayed all ref updates > to the end by replacing this with: > > label bundle-redo/fetch > > and then at the end of the todo list we'd add: > > exec git update-ref refs/heads/bundle-redo/fetch refs/rewritten/bundle-redo/fetch > > If we do all of those ref updates in a single transaction at the end, it > should be much easier to roll back from if desired, and we'd avoid the > aborted-rebase problem entirely.
;-)