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

Re: [PATCH] checkout: add remoteBranchTemplate config for DWIM branch names

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 23, 2025, 00:51 UTC
Message-ID
<xmqqy0muqaut.fsf@gitster.g>
In-Reply-To
<7246f693-2047-4218-8103-8143e01032f0@gmail.com>
pasteley <ceasebeing@gmail.com> writes:
Show 8 quoted lines
> 1. Server-side policies/hooks that require a namespace on the remote
>     (e.g. `team/*`, `users/<id>/*`, `release/*`).
> 2. Hosting / mirroring setups where remote branches live under a fixed
>     prefix for organizational or access-control reasons.
> 3. Migrations where the remote branch layout is constrained by the
>     target system, while local developer workflows assume short names.
>
> In these scenarios developers do not create the problem, they inherit it.

Nobody stops you from interacting with projects like the above, and locally name branches you store your work in users/pasteley/topic-1 instead of topic-1, no?

> While `push.default=matching` has been deprecated since Git 2.0 (~ 2014),
> we still can handle this corner case by detecting the incompatibility
> and providing a clear error message.

I do not know if you are confused, or if you are citing somebody else's description that is confused, but the word "deprecated" in the above statement is misused. So is "corner case".

When we talk about deprecation, the deprecated feature is something that is not useful for anybody to adopt because there are better alternatives available, we wish there is no need to support the users, and we hope we can remove it eventually someday. The matching push does not fall into that category at all.

What we did in Git 2.0 was to change the default from matching to simple, because the matching is the most useful for those who publish their changes, and for those who are merely participating somebody else's project, it is not suited. The matching push is also harder to use properly if a project has multiple people who push to a single repository (i.e., central repository approach). The default was switched to make life easier for more people. It did not diminish the usefulness of the matching mode for the developers for whom the matching was the most useful mode.

Previous: pasteleyNext: pasteley
Message 4 of 5 in “checkout: add remoteBranchTemplate config for DWIM branch names”
  1. checkout: add remoteBranchTemplate config for DWIM branch namesPasteley Absurda via GitGitGadget, Dec 21, 2025
  2. Junio C HamanoDec 22, 2025
  3. pasteleyDec 22, 2025
  4. Junio C HamanoDec 23, 2025
  5. pasteleyDec 23, 2025

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.