git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Junio C Hamano
Message 23 of 23 in “branch: add 'branch.addCurrentBranchAsPrefix' config param”
  1. branch: add 'branch.addCurrentBranchAsPrefix' config paramYoann Valeri via GitGitGadget, Feb 20, 2026
  2. Junio C HamanoFeb 20, 2026
  3. Junio C HamanoFeb 20, 2026
  4. 0/2 branch: add 'branch.addCurrentBranchAsPrefix' config paramYoann Valeri via GitGitGadget, Feb 27, 2026
  5. 1/2 branch: add 'branch.addCurrentBranchAsPrefix' config paramVALERI Yoann via GitGitGadget, Feb 27, 2026
  6. 2/2 branch: add a no-prefix optionVALERI Yoann via GitGitGadget, Feb 27, 2026
  7. Junio C HamanoFeb 27, 2026
  8. 0/3 branch: add prefixes to new branch namesYoann Valeri via GitGitGadget, Mar 6, 2026
  9. 1/3 branch: add '--name-prefix' optionVALERI Yoann via GitGitGadget, Mar 6, 2026
  10. Eric SunshineMar 7, 2026
  11. Junio C HamanoMar 8, 2026
  12. 2/3 branch: add 'branch.namePrefix' config paramVALERI Yoann via GitGitGadget, Mar 6, 2026
  13. Eric SunshineMar 7, 2026
  14. 3/3 branch: add '--no-name-prefix' optionVALERI Yoann via GitGitGadget, Mar 6, 2026
  15. Junio C HamanoMar 6, 2026
  16. Junio C HamanoMar 6, 2026
  17. Eric SunshineMar 7, 2026
  18. Junio C HamanoMar 8, 2026
  19. 0/2 branch: add prefixes to new branch namesYoann Valeri via GitGitGadget, Apr 9, 2026
  20. 1/2 branch: add '--name-prefix' optionVALERI Yoann via GitGitGadget, Apr 9, 2026
  21. 2/2 branch: add 'branch.namePrefix' config paramVALERI Yoann via GitGitGadget, Apr 9, 2026
  22. Junio C HamanoApr 9, 2026
  23. Junio C HamanoApr 9, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.