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

Re: DWIM ref names for push/fetch

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 25, 2007, 00:09 UTC
Message-ID
<7v3b0gq4id.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0706241808550.4740@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> writes:
> Is this difference simply due to the different languages the matching 
> portions of these were originally written in?

If anything, the semantics on the fetch side is _very_ much intentional and is done deliberately that way to be usable.

On the other hand, push started as "matching only", and then "match tail part of the name" as an afterthought. It was so afterthought that it had an idiotic behaviour of independently match the source and destination side even when there is no colon, which was fixed only recently.

So if you would want to match fetch and push, you should not change the semantics on fetch to match what push does, as the latter was done pretty much without design.

Having said that, I think fetch and push DWIMmery are fundamentally different, especially when you do not have a colon. push without storing anything on the receiving end would not make any sense whatsoever, but fetch without using tracking branches does make perfect sense, so push does pretend dst side has what matched with src side pattern, while fetch treats no colon pattern as not storing. IOW, even if we wanted to reuse the code on both sides as much as possible, I suspect we would need to have details different between them.

Previous: Daniel BarkalowNext: Daniel Barkalow
Message 2 of 6 in “DWIM ref names for push/fetch”
  1. Daniel BarkalowJun 24, 2007
  2. Junio C HamanoJun 25, 2007
  3. Daniel BarkalowJun 25, 2007
  4. Junio C HamanoJun 25, 2007
  5. Daniel BarkalowJun 25, 2007
  6. Julian PhillipsJun 25, 2007

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.