Git development
 help / color / mirror / Atom feed
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 13:02:31 -0700	[thread overview]
Message-ID: <xmqqqzonsy08.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:

> +test_expect_success 'create branch with config prefix' '
> +	test_config branch.autosetupmerge false &&
> +	test_config branch.namePrefix blob &&
> +	git branch -- -with-prefix &&
> +	test_ref_exists refs/heads/blob-with-prefix &&

Another thing I noticed.

Wouldn't you rather want to have a mechanism where the user does not
have to prefix the end-user supplied value ("with-prefix" in this
case) without leading dash?  From the look of what you are trying to
configure with the variable, the desire seems to be to allow the
user to make many branches that share the same prefix, so
conceptually, among blob-master, blob-maint, blob-feature branches
that would result in "git branch $name" where name is taken from the
vocabulary (master, maint, feature), the responsibility to supply
the word-separating hyphen belongs to either the prefix side (i.e.,
"blob-") or the mechanism that does prefising (i.e., the prefix
configuration @{current} comes up with a prefix string "blob", and
with the end-user supplied value of "with-prefix", the mechanism
that pastes these two strings makes the result "blob-with-prefix",
supplying the hyphen between "blob" and "with-prefix".

I said that I am negative in my previous message, simply because I
didn't get the intended use case at all, but even if there were a
good use case explained in future messages to make me change my
mind, I doubt that a design that requires the hyphen in front of
"with-prefix" the end-user is supposed to supply is a good thing to
have.

Thanks.

      parent reply	other threads:[~2026-04-09 20:02 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
2026-04-09 20:02         ` Junio C Hamano [this message]

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=xmqqqzonsy08.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