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

Re: Question regarding git fetch

From
Avery Pennarun <apenwarr@gmail.com>
Date
Aug 27, 2009, 17:22 UTC
Message-ID
<32541b130908271022i6a825198i37e2ec82ed5f833c@mail.gmail.com>
In-Reply-To
<20090827164657.GA17090@atjola.homenet>
2009/8/27 Björn Steinbrink <B.Steinbrink@gmx.de>:
Show 6 quoted lines
> It would also be pretty hard to implement that. Given the default fetch
> refspec, it would "simply" be a matter of mapping the given ref to the
> refspec, so e.g. "foo" becomes "refs/heads/foo:refs/remotes/origin/foo".
> But even just using "git remote add -t master foo git://..." breaks
> that, as the fetch refspec in the config will no longer be a glob, and
> thus no such mapping is possible.

Hmm, I don't really see why that introduces a problem. If you use -t to override explicitly which refs you want to save, then it's not a problem if git doesn't save other refs, right?

I'd be more concerned about the inconsistency between
   git fetch git://whatever master
and
   git fetch origin master

There's no really good way for the first one to know it needs to update any branches, even though 'origin' might be an alias for git://whatever. So users will still be confused.

Thinking of that also reminds me of another surprise.  If you do:
   git fetch git://whatever

...it seems to do nothing at all, as far as I can see. Which makes sense, I guess, since I wouldn't really expect it to be meaningful. But it seems to connect up to the remote server anyway just in case.

I suppose I have no useful suggestions here, other than an interpretation of why users find the current behaviour confusing.

Have fun,
Avery
Previous: Björn SteinbrinkNext: Jeff King
Message 6 of 17 in “Question regarding git fetch”
  1. Tom LambdaAug 27, 2009
  2. Avery PennarunAug 27, 2009
  3. Eric RaibleAug 27, 2009
  4. Avery PennarunAug 27, 2009
  5. Björn SteinbrinkAug 27, 2009
  6. Avery PennarunAug 27, 2009
  7. Jeff KingAug 27, 2009
  8. Jeff KingAug 27, 2009
  9. Junio C HamanoAug 27, 2009
  10. Jeff KingAug 27, 2009
  11. Jeff KingAug 27, 2009
  12. Avery PennarunAug 27, 2009
  13. Jeff KingAug 27, 2009
  14. Avery PennarunAug 27, 2009
  15. Junio C HamanoAug 27, 2009
  16. Jeff KingAug 27, 2009
  17. Tom LambdaAug 28, 2009

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.