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

Re: Ensimag students projects, version 2013

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 15, 2013, 14:53 UTC
Message-ID
<7v1uab26bn.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20130415140513.GA16154@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 22 quoted lines
> On Mon, Apr 15, 2013 at 11:24:21AM +0200, Matthieu Moy wrote:
>
>> > * git pull --set-upstream
>> >
>> >   This is vaguely related to another itch that nobody has bothered to
>> >   fix: 'git fetch origin foo' should really update origin/foo.  This has
>> >   been discussed on the list a few times already:
>> >
>> >     http://thread.gmane.org/gmane.comp.version-control.git/192252
>> >     http://thread.gmane.org/gmane.comp.version-control.git/165720/focus=165758
>> >
>> >   which by the way would be a *great* thing to fix, hint hint ;-)  and
>> >   since Peff already posted a POC patch in the first thread, it's
>> >   probably not that hard.  (Peff?)
>> 
>> My understanding is that this would be technically easy to fix, but a
>> migration plan is needed, which isn't easy for a one-shot, one-month
>> contribution.
>
> Yes. The concept isn't that hard, but the question was one of whether it
> would break some obscure workflows. But I don't remember all of the
> details; I think I gave some examples in past threads.
I think the one Thomas lists in $gmane/165758 is the one.

It has been the way for users to make sure that origin/master stays put to explicitly tell Git not to update the remote tracking branch using a refspec without colon, so that they can do

	git fetch origin master
	git log origin/master..FETCH_HEAD

(or its three-dot variant) to gauge the progress of the other side since the last time the user observed.

Personally I doubt this trick is so relevant these days, not just because we can look at reflog of origin/master. The user could just do

	old=$(git rev-parse origin/master)
        git fetch origin master
        git log $old..FETCH_HEAD

even with a modified Git that updates the remote tracking branches without a storing refspec.

The primary reason why I do not think this is relevant these days is because the original premise "remote tracking branches keep what the last 'git fetch' observed" has already been broken for a long time. The users are better off thinking that the remote tracking branches can be updated any time (not just the last 'git fetch') when Git observes (or could observe) the state of the remote without being told explicitly with today's "pretend as if we fetched immediately after we push" behaviour.

Previous: Jeff KingNext: Jeff King
Message 8 of 21 in “Ensimag students projects, version 2013”
  1. Matthieu MoyApr 14, 2013
  2. Ping YinApr 15, 2013
  3. Matthieu MoyApr 15, 2013
  4. Thomas RastApr 15, 2013
  5. Matthieu MoyApr 15, 2013
  6. John KeepingApr 15, 2013
  7. Jeff KingApr 15, 2013
  8. Junio C HamanoApr 15, 2013
  9. Jeff KingApr 16, 2013
  10. Duy NguyenApr 15, 2013
  11. Ramkumar RamachandraApr 15, 2013
  12. Junio C HamanoApr 15, 2013
  13. Matthieu MoyApr 15, 2013
  14. Jeff KingApr 16, 2013
  15. Junio C HamanoApr 16, 2013
  16. Ramkumar RamachandraApr 16, 2013
  17. Ramkumar RamachandraApr 16, 2013
  18. Junio C HamanoApr 16, 2013
  19. Ramkumar RamachandraApr 16, 2013
  20. Ramkumar RamachandraApr 16, 2013
  21. Phil HordApr 16, 2013

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.