Re: [PATCH v14 4/6] branch: add --prune-merged <branch>
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 18, 2026, 16:08 UTC
- Message-ID
- <xmqqcxxnsufl.fsf@gitster.g>
- In-Reply-To
- <37f2a483-c8bf-4c24-84de-c6233cc20b25@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 5 quoted lines
> One thing I've just thought of related to this patch is whether we want > to protect branches that are the upstreams of branches that are not > slated for deletion. With stacked branches it is possible that a branch > has been merged but has other branches stacked on top of it that have > not been merged.
An interesting point. We do have "this topic is built on the result of merging these other topics into main" and I expect the practice is wide spread. These base topics may graduate first, but other topics may still be updated.
But when you rewrite these other topics, wouldn't you leave their bases untouched? IOW, a new iteration (i.e. "rebase -i") would reuse the base that was used in an earlier iteration, i.e. the result of an earlier merge of the other topics, some of which might have been pruned since then, into an older 'main', so it is OK to lose these other topics once they have graduated, simply because you wouldn't be recreating the merge that you used as the base of this remaining topic, no?
Or am I missing something?
Thanks.