Re: [PATCH v4 2/2] branch: add 'branch.namePrefix' config param
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 9, 2026, 20:02 UTC
- Message-ID
- <xmqqqzonsy08.fsf@gitster.g>
- In-Reply-To
- <80d1ffde9d3d55d0ff2b28219e2484fb12d543d9.1775731390.git.gitgitgadget@gmail.com>
"VALERI Yoann via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 5 quoted lines
> +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.