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

Re: What should "git fetch origin +next" should do?

From
Jeff King <peff@peff.net>
Date
Oct 17, 2011, 17:10 UTC
Message-ID
<20111017171041.GA12837@sigill.intra.peff.net>
In-Reply-To
<7v7h45s8rh.fsf@alter.siamese.dyndns.org>
On Sun, Oct 16, 2011 at 12:20:02AM -0700, Junio C Hamano wrote:
Show 10 quoted lines
> I just tried to update one of them with "git pull --ff-only", and after
> seeing that the fetch phase failed with non-ff on 'next', ran
> 
> 	$ git fetch origin +next
> 
> which happily copied the tip of updated next to FETCH_HEAD and nowhere
> else. Of course, a colon-less refspec means do not store it anywhere,
> i.e. "<colon-less-refspec>" === "<colon-less refspec>:", so prefixing it
> with '+' to force would logically be a no-op.  But it nevertheless was
> somewhat surprising and irritating.
I don't see that this has anything to do with the "+" at all. If I said:
  $ git fetch origin next

I think the exact same confusion exists. I told git to update 'next' from origin, but it didn't touch refs/remotes/origin/next. You and I both know what is happening, because we understand that "next" is a refspec, and that it has no RHS. But I suspect that is not how many git users think of it.

We've discussed this before, of course:
  http://thread.gmane.org/gmane.comp.version-control.git/127163/focus=127215
-Peff
Previous: Ramkumar RamachandraNext: Junio C Hamano
Message 6 of 10 in “What should "git fetch origin +next" should do?”
  1. Junio C HamanoOct 16, 2011
  2. Marc BranchaudOct 17, 2011
  3. Ramkumar RamachandraOct 17, 2011
  4. Junio C HamanoOct 17, 2011
  5. Ramkumar RamachandraOct 17, 2011
  6. Jeff KingOct 17, 2011
  7. Junio C HamanoOct 17, 2011
  8. Marc BranchaudOct 17, 2011
  9. Junio C HamanoOct 19, 2011
  10. Marc BranchaudOct 19, 2011

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.