From: Thomas Rast <trast@inf.ethz.ch>
To: Jeff King <peff@peff.net>
Cc: <git@vger.kernel.org>, Jonathan Nieder <jrnieder@gmail.com>,
"Michael Haggerty" <mhagger@alum.mit.edu>
Subject: Re: [PATCH 4/4] fetch: opportunistically update tracking refs
Date: Sun, 12 May 2013 11:15:16 +0200 [thread overview]
Message-ID: <871u9cftjv.fsf@linux-k42r.v.cablecom.net> (raw)
In-Reply-To: <20130511161652.GD3270@sigill.intra.peff.net> (Jeff King's message of "Sat, 11 May 2013 18:16:52 +0200")
Jeff King <peff@peff.net> writes:
> When we run a regular "git fetch" without arguments, we
> update the tracking refs according to the configured
> refspec. However, when we run "git fetch origin master" (or
> "git pull origin master"), we do not look at the configured
> refspecs at all, and just update FETCH_HEAD.
>
> We miss an opportunity to update "refs/remotes/origin/master"
> (or whatever the user has configured). Some users find this
> confusing, because they would want to do further comparisons
> against the old state of the remote master, like:
>
> $ git pull origin master
> $ git log HEAD...origin/master
I agree with the patch, but I would use a different reasoning. Your
example here is not even correct because the range in the second command
would be empty unless the merge conflicted.
I believe the more common confusion stems from the tracking displays in
git-checkout and others. The issue there is that we *internally* treat
origin/masters as a kind of mirror, and the tracking displays all go
against user expectations once they have seen a newer state of origin's
master by explicit pull or fetch.
Michael also pointed out yesterday that short of
git fetch origin master:refs/remotes/origin/master
there is no way to fetch only one branch.
--
Thomas Rast
trast@{inf,student}.ethz.ch
next prev parent reply other threads:[~2013-05-12 9:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-11 16:13 [RFC/PATCH 0/4] update tracking refs on explicit fetch Jeff King
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 [this message]
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=871u9cftjv.fsf@linux-k42r.v.cablecom.net \
--to=trast@inf.ethz.ch \
--cc=git@vger.kernel.org \
--cc=jrnieder@gmail.com \
--cc=mhagger@alum.mit.edu \
--cc=peff@peff.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.