From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Cc: Thomas Rast <trast@student.ethz.ch>,
Jonathan Nieder <jrnieder@gmail.com>
Subject: [RFC/PATCH 0/4] update tracking refs on explicit fetch
Date: Sat, 11 May 2013 18:13:21 +0200 [thread overview]
Message-ID: <20130511161320.GA14990@sigill.intra.peff.net> (raw)
This is a cleaned-up version of the oft-discussed[1] concept that "git
pull origin master" should update "refs/remotes/origin/master".
It is a little bit of a risky change, in that anybody who deeply cares
about when their tracking ref branches are updated would be impacted.
But I think the general consensus is that while you can come up with a
hypothetical use case, the logic is quite tortured, and you could
accomplish the same thing by keeping a local branch. Most people seem to
have the mental model that remote tracking branches are basically a
cache for what's on the remote, updated opportunistically as
appropriate.
[1/4]: t5510: start tracking-ref tests from a known state
[2/4]: fetch/pull doc: untangle meaning of bare <ref>
[3/4]: refactor "ref->merge" flag
[4/4]: fetch: opportunistically update tracking refs
The final patch is the moral equivalent of the patch I've posted before
when this topic comes up (and referenced in the threads below). But that
patch did not take care not to write duplicate (mergable!) entries into
FETCH_HEAD, leading to great confusion from git-pull. This series deals
with that, and takes care to write the exact same FETCH_HEAD we would
have written before the series.
However, Jonathan raised an interesting question: what is the point of
not-for-merge entries at all? We are not going to merge them, so none of
the pull/merge machinery cares about them. We do not consider extra
entries in FETCH_HEAD for reachability or anything like that. Is there
anybody who reads them?
If we do not care about them, we can simplify this much further, and
either write the duplicates as not-for-merge, or even omit not-for-merge
entries entirely. However, it is possible that some third-party scripts
process FETCH_HEAD, so I took the conservative route.
Note that this patch is as greedy as possible[2]; whenever we see the
LHS is fetched, we update the RHS side, even if the user did:
git fetch origin master:foobar
Some of the discussions below argue that the behavior should not kick in
for such a case. I am not sure I agree (and argue against it in those
discussions). I think at this point that is the only potentially
contentious item.
-Peff
[1] Past discussions:
http://thread.gmane.org/gmane.comp.version-control.git/127163/focus=127215
http://thread.gmane.org/gmane.comp.version-control.git/192252
http://thread.gmane.org/gmane.comp.version-control.git/203357/focus=203442
http://article.gmane.org/gmane.comp.version-control.git/221234
next reply other threads:[~2013-05-11 16:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-11 16:13 Jeff King [this message]
2013-05-11 16:14 ` [PATCH 1/4] t5510: start tracking-ref tests from a known state Jeff King
2013-05-14 22:18 ` Eric Sunshine
2013-05-11 16:14 ` [PATCH 2/4] fetch/pull doc: untangle meaning of bare <ref> Jeff King
2013-05-11 16:15 ` [PATCH 3/4] refactor "ref->merge" flag Jeff King
2013-05-11 16:16 ` [PATCH 4/4] fetch: opportunistically update tracking refs Jeff King
2013-05-12 9:15 ` Thomas Rast
2013-05-12 9:41 ` Thomas Rast
2013-05-16 3:37 ` Jeff King
2013-08-06 16:28 ` Junio C Hamano
2013-08-06 21:46 ` Jeff King
2013-08-06 22:12 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130511161320.GA14990@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=jrnieder@gmail.com \
--cc=trast@student.ethz.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).