Subject: Re: [PATCH v3 0/3] branch: add prefixes to new branch names

From: Junio C Hamano <[email-masked]>
Date: Fri, 06 Mar 2026 13:01:28 -0800

"Yoann Valeri via GitGitGadget" <[email-masked]> writes:

> This PR adds a way to add prefixes to a new branch being created. The goal
> is mostly to ease the developer process of creating new branches by adding
> shortcuts that can be set either with a command-line option or with
> configuration parameter. This is useful especially when you have to do
> similar backports on multiple branches, removing a bit of the need for
> finding names or typing the names over and over again.
>
> Changes since v1:
>
>  * Added a '--no-prefix' option to git branch
>
> Changes since v2:
>
>  * Changed the PR structure, with 3 patches:
>    * first patch adds the '--name-prefix' option
>    * second adds the 'branch.namePrefix' configuration parameter
>    * third adds the '--no-name-prefix' option
>  * Those patches only target 'git branch' now

I haven't read the actual patches, but the first step that adds
"--name-prefix" should also support "--no-name-prefix" at the same
time, with or without patches 2 and 3.  Doing so would allow users
with an alias

    [alias] bn = branch --name-prefix=blah

, who want to almost always add "blah" to their branches, to defeat
the prefix in rare occasions with

    $ git bn --no-name-prefix foo