Re: [PATCH v10 1/4] branch: add --forked <branch>
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- May 22, 2026, 06:18 UTC
- Message-ID
- <273103d7-c816-4cde-9e89-b630c37b0749@kdbg.org>
- In-Reply-To
- <f2df15983067ce39b6c33ab81115863d5c3567f4.1779403204.git.gitgitgadget@gmail.com>
Am 22.05.26 um 00:40 schrieb Harald Nordgren via GitGitGadget:
Show 9 quoted lines
> diff --git a/Documentation/git-branch.adoc b/Documentation/git-branch.adoc > index c0afddc424..3a421f6663 100644 > --- a/Documentation/git-branch.adoc > +++ b/Documentation/git-branch.adoc > @@ -24,6 +24,7 @@ git branch (-m|-M) [<old-branch>] <new-branch> > git branch (-c|-C) [<old-branch>] <new-branch> > git branch (-d|-D) [-r] <branch-name>... > git branch --edit-description [<branch-name>] > +git branch --forked <branch>...
I would have preferred that this option is another filter of --list mode, not its own mode of operation. Consequently, each --forked option would take only a single argument (which can contain globs), and can be given multiple times.
Show 12 quoted lines
> > DESCRIPTION > ----------- > @@ -199,6 +200,12 @@ This option is only applicable in non-verbose mode. > Print the name of the current branch. In detached `HEAD` state, > nothing is printed. > > +`--forked`:: > + List local branches whose configured upstream matches any > + of the given _<branch>_ arguments. Each argument is either > + a ref (e.g. `origin/master`, `master`) or a shell-style > + glob (e.g. `'origin/*'`). Multiple arguments are unioned.
So this could perhaps read:
`--forked`:: List only branches whose configured upstream matches _<branch>_. The argument can contain a shell-style glob (e.g. `'origin/*'`). The option can be repeated to widen the filter.
Note that there is no reason to say "local branches". ("... are unioned" sounds strange, so this is may attempt to express the same in a different way.)
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.
-- Hannes