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

Re: history missing

From
Jeff King <peff@peff.net>
Date
Nov 8, 2010, 18:28 UTC
Message-ID
<20101108182801.GC30428@sigill.intra.peff.net>
In-Reply-To
<AANLkTi=eFJ5qTWLD-AdczeDtSAtxs9xihuO+QQ8tVLyj@mail.gmail.com>
On Mon, Nov 08, 2010 at 09:14:27AM -0500, Martin von Zweigbergk wrote:
Show 12 quoted lines
> On Mon, Nov 8, 2010 at 8:48 AM, Jakub Narebski <jnareb@gmail.com> wrote:
> > On Mon, 8 Nov 2010, Martin von Zweigbergk wrote:
> >> Sorry, maybe I misunderstood what the confusion was about. What I was
> >> referring to was the confusion caused by 'git fetch origin master' not
> >> updating 'refs/remotes/origin/master'.
> >
> > Should it really do it?  What if it does not exist?  What if <remote>
> > is specified via URL?
> 
> I would probably not expect it to be updated (even if the URL matches a
> configured remove). If the reference does not yet exist, I think I would
> expect it to be created.

Yeah, the patch I posted a while back (and referenced below) does not convert URLs into remote names (nor do I think it should). But if you give it the name of a configured remote, and it is fetching a ref from the remote that is mentioned on the LHS of a configured fetch refspec, it will update the matching RHS of that refspec opportunistically.

So it should be pretty unsurprising to the user (see the thread below for some discussion of when it could be surprising).

> Also see http://thread.gmane.org/gmane.comp.version-control.git/127163/.
> Junio, Jeff and Avery can argue much better for and against this than I
> can. I read it at some point, but I don't quite remember now if they did
> discuss the historical reasons for the current behavior in that thread.

I took a look at cleaning up the patch from that thread. It causes 4 of the test scripts to fail. Most disturbing is this one:

  $ grep explicit.fetch t/t5510-fetch.sh
  test_expect_success 'explicit fetch should not update tracking' '

which checks for the direct opposite of the behavior we are discussing. The test was added by Junio in late 2007. However, I can't seem to find any discussion on the mailing list about it. Junio, do you remember anything about this?

-Peff
Previous: Martin von ZweigbergkNext: Alex Riesen
Message 9 of 10 in “history missing”
  1. Vitaliy SemochkinOct 26, 2010
  2. Sverre RabbelierOct 26, 2010
  3. Jonathan NiederNov 8, 2010
  4. Martin von ZweigbergkNov 8, 2010
  5. Jakub NarebskiNov 8, 2010
  6. Martin von ZweigbergkNov 8, 2010
  7. Jakub NarebskiNov 8, 2010
  8. Martin von ZweigbergkNov 8, 2010
  9. Jeff KingNov 8, 2010
  10. Alex RiesenNov 8, 2010

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.