Re: [PATCH v10 1/4] branch: add --forked <branch>
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- May 22, 2026, 11:25 UTC
- Message-ID
- <190c909d-4c17-488f-9ebe-f7927ebf7e87@kdbg.org>
- In-Reply-To
- <CAHwyqnX=zvjpy3w8qn+H7L_Ncxs5+tK5Va-Lr4ZXX=XYLs2YZQ@mail.gmail.com>
Am 22.05.26 um 12:49 schrieb Harald Nordgren:
Show 15 quoted lines
>> Johannes Sixt <j6t@kdbg.org> writes: >> >>> The icing on the cake would now be that >>> >>> git branch --merged origin/main --forked origin/* >>> >>> provides the list of branches forked from origin that have already been >>> integrated. >> >> Yup, that is very nice. Also with "--merged" replaced with >> "--not-merged", i.e., "our work building on top of origin's, and >> still need to be finished", would give us a good list to work on. > > This is nice, but I think this would require an overhaul of other > infra as well, maybe better to do as a follow-up?
This can certainly be done as an extension in a follow-up patch. But the UI must still be planned accordingly, i.e., --forked can only take a single argument. For example, in
git branch --forked foo bar
'bar' is the pattern of branches to show. The "list" is filtered according to '--forked foo'. That is, if 'bar' was not forked from 'foo', the output is empty.
You would have to require
git branch --forked foo --forked bar
to list all branches forked from 'foo' or 'bar'.
In the first implementation, you can restrict uses of other options with --forked or even with a branch pattern. But you cannot be loose by accepting multiple branch patterns with one --forked option, because that would later clash with --list mode.
-- Hannes