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

Re: The fetch command should "always" honor remote.<name>.fetch

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 9, 2014, 18:40 UTC
Message-ID
<xmqqioqi1h4a.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAHwd=GnRHM9Nk7SzCL46cLTrxgGYH+F9O7KBOxnJmAQQRvKhSA@mail.gmail.com>
Lewis Diamond <git@lewisdiamond.com> writes:
> ... Yes, I agree that the abbreviation expansion works as designed
> (using the rev_parse_rules), 

I am not fundamentally opposed if you want to add a new command line option to "git fetch" so that the shortened "what to fetch" are dwimmed differently, but changing how "git fetch there master" without any such option behaves will not fly well. It will break those who have already learned Git who expect that that is the way to explicitly ask to fetch the master branch regardless of what configuration the repository might have.

It is true that "git fetch there 'master'" cannot possibly mean the 'master' branch we locally have, so there is no fundamental reason why we should use the same rev-parse dwim rules to grok them.

In fact we used to have different dwim rules for local (rev-parse dwim rules) and for remote access --- I do not offhand recall if we had rules for push and fetch separately, but I wouldn't be surprised if we did. The underlying mechanism certainly allowed us to use separate rules for them back then.

Over time, however, having separate rules for remote and local was found confusing by users, and that is why we changed the code to use the same rule everywhere when dwimming the abbreviated refname on the command line these days.

Previous: Lewis Diamond
Message 6 of 6 in “The fetch command should "always" honor remote.<name>.fetch”
  1. Lewis DiamondApr 5, 2014
  2. Junio C HamanoApr 7, 2014
  3. Lewis DiamondApr 7, 2014
  4. Junio C HamanoApr 9, 2014
  5. Lewis DiamondApr 9, 2014
  6. Junio C HamanoApr 9, 2014

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.