From: Junio C Hamano <gitster@pobox.com>
To: "VALERI Yoann via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Patrick Steinhardt <ps@pks.im>,
Yoann Valeri <yoann.valeri@cea.fr>,
Eric Sunshine <sunshine@sunshineco.com>
Subject: Re: [PATCH v4 2/2] branch: add 'branch.namePrefix' config param
Date: Thu, 09 Apr 2026 12:52:14 -0700 [thread overview]
Message-ID: <xmqqv7dzsyhd.fsf@gitster.g> (raw)
In-Reply-To: <80d1ffde9d3d55d0ff2b28219e2484fb12d543d9.1775731390.git.gitgitgadget@gmail.com> (VALERI Yoann via GitGitGadget's message of "Thu, 09 Apr 2026 10:43:10 +0000")
"VALERI Yoann via GitGitGadget" <gitgitgadget@gmail.com> writes:
> +`branch.namePrefix`::
> + When a new branch is created with `git branch`, use the provided value as
> + prefix for its name. Can be '@{current}' to use the current branch's name
> + as prefix. This value can be overriden by using the '--[no-]name-prefix'
> + option of `git branch`.
Even after reading the cover letter, I am not convinced why this is
a good idea in the first place.
Also, I am not sure if "current branch" really captures what you are
trying to achieve. When "git branch foo" creates a new branch "foo"
out of _the_ _current_ branch, i.e.
$ git checkout base
$ git branch foo
with the nameprefix configuration, it may appear that it is doing
what you want by deriving the name of the new branch taking both
"base" and "foo" into account, but what would you want to happen if
you did this instead:
$ git checkout base
$ git branch foo
or while you may be on an unrelated "master" branch, create and
switch to the new branch:
$ git checkout -b foo base
whose name takes both "base" and "foo" into account.
What I am getting at is that "the current branch" is missing the
point and it may be "the branch the new branch was forked off of"
that is what you really are trying to find that "base" in.
Having said all that, I am fairly negative on this new feature,
simply because it is too much magic and will be confusing,
especially when invoked with a configuration variable.
next prev parent reply other threads:[~2026-04-09 19:52 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-20 8:07 [PATCH] branch: add 'branch.addCurrentBranchAsPrefix' config param Yoann Valeri via GitGitGadget
2026-02-20 15:59 ` Junio C Hamano
2026-02-20 16:08 ` Junio C Hamano
2026-02-27 15:48 ` [PATCH v2 0/2] " Yoann Valeri via GitGitGadget
2026-02-27 15:48 ` [PATCH v2 1/2] " VALERI Yoann via GitGitGadget
2026-02-27 15:48 ` [PATCH v2 2/2] branch: add a no-prefix option VALERI Yoann via GitGitGadget
2026-02-27 17:07 ` Junio C Hamano
2026-03-06 13:14 ` [PATCH v3 0/3] branch: add prefixes to new branch names Yoann Valeri via GitGitGadget
2026-03-06 13:14 ` [PATCH v3 1/3] branch: add '--name-prefix' option VALERI Yoann via GitGitGadget
2026-03-07 7:06 ` Eric Sunshine
2026-03-08 7:06 ` Junio C Hamano
2026-03-06 13:14 ` [PATCH v3 2/3] branch: add 'branch.namePrefix' config param VALERI Yoann via GitGitGadget
2026-03-07 7:07 ` Eric Sunshine
2026-03-06 13:14 ` [PATCH v3 3/3] branch: add '--no-name-prefix' option VALERI Yoann via GitGitGadget
2026-03-06 21:38 ` Junio C Hamano
2026-03-06 21:01 ` [PATCH v3 0/3] branch: add prefixes to new branch names Junio C Hamano
2026-03-07 7:05 ` Eric Sunshine
2026-03-08 6:48 ` Junio C Hamano
2026-04-09 10:43 ` [PATCH v4 0/2] " Yoann Valeri via GitGitGadget
2026-04-09 10:43 ` [PATCH v4 1/2] branch: add '--name-prefix' option VALERI Yoann via GitGitGadget
2026-04-09 10:43 ` [PATCH v4 2/2] branch: add 'branch.namePrefix' config param VALERI Yoann via GitGitGadget
2026-04-09 19:52 ` Junio C Hamano [this message]
2026-04-09 20:02 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqv7dzsyhd.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=ps@pks.im \
--cc=sunshine@sunshineco.com \
--cc=yoann.valeri@cea.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox