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

DWIM ref names for push/fetch

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Jun 24, 2007, 22:25 UTC
Message-ID
<Pine.LNX.4.64.0706241808550.4740@iabervon.org>
AFAICT, the rules are currently:

for push, we compare the source against the list of local refs, and do some complicated stuff to figure out what it matches. Then we compare the destination against the list of remote refs (with no destination being interpreted as the full name of the source), and do the same complicated stuff.

for fetch, we accept anything that starts with "refs/heads/", "refs/tags/", or "refs/remotes/"; prepend "refs/" to anything that starts with "heads/", "tags/", or "remotes/"; and prepend "refs/heads/" to anything else. (NB: I'm looking at Julian's C translation, rather than the original shell scripts, which I find inpenetrable).

Is this difference simply due to the different languages the matching portions of these were originally written in? Would it be okay to change fetch to work like push? It would be nice to have a single procedure for determining which (if any) of a list of refs is the match for some string, regardless of why we're looking.

	-Daniel
*This .sig left intentionally blank*
Next: Junio C Hamano
Message 1 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.