git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>, git@vger.kernel.org
Subject: Re: [question] how can i verify whether a local branch is tracking a remote branch?
Date: Mon, 6 Apr 2009 01:49:20 -0400	[thread overview]
Message-ID: <20090406054920.GA19214@coredump.intra.peff.net> (raw)
In-Reply-To: <7vy6uecpwd.fsf@gitster.siamese.dyndns.org>

On Sun, Apr 05, 2009 at 10:28:02PM -0700, Junio C Hamano wrote:

> > I don't think it would be unreasonable to expose this functionality via
> > "for-each-ref". Something like this (which would need cleanup,
> > documentation, and perhaps a :short variant):
> 
> I think that is a sane approach, but isn't "tracking" a misnomer?  I think
> what you are describing is what is called "the upstream branch" by the
> description of Documentation/config.txt::branch.<name>.merge, and not what
> people call "tracking branch" (see Documentation/glossary-content.txt).

I think this is the classic "both of these concepts are called
tracking and it is confusing" that people complain about from time to
time. This is the value created by "--track", and most of the internal
functions call it that (e.g., stat_tracking_info, fill_tracking_info,
etc).

But I am happy to call it something else if it will reduce confusion.
"upstream" is a fine name, I think (though that is often referring to
the upstream _repository_, so maybe somebody might expect it to print
"origin" here).

> I also wonder if you want to say "this remote" and "that branch"
> separately.  As far as I can tell you are not giving the former but only
> the latter information?

Well, I don't think they are two separate parts. "that branch" has
already used information about the remote to reach its answer, and is
self-contained. It's all you need to know to do any non-fetching
operations (like seeing how your commits compare with upstream's, for
example).

Which isn't to say "this remote" might not be interesting. But I think
that is somewhat independent of this value, and moreover, it is already
trivial to find via "branch.*.remote" (or are there lookup rules I am
forgetting about?). The point of this exercise was that it is very
tricky to do the "upstream" correctly, so exposing the C code makes
sense.

-Peff

  reply	other threads:[~2009-04-06  5:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-05 10:32 [question] how can i verify whether a local branch is tracking a remote branch? Paolo Ciarrocchi
2009-04-05 14:44 ` Jeff King
2009-04-05 21:25   ` Paolo Ciarrocchi
2009-04-06  4:34     ` Jeff King
2009-04-06  5:28       ` Junio C Hamano
2009-04-06  5:49         ` Jeff King [this message]
2009-04-06  8:30       ` Paolo Ciarrocchi
2009-04-06 21:25         ` Jeff King
2009-04-06 22:00           ` Paolo Ciarrocchi
2009-04-07  4:41             ` Jeff King
2009-04-06 12:00       ` Michael J Gruber
2009-04-06 21:29         ` Jeff King
2009-04-07  7:59           ` Michael J Gruber

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=20090406054920.GA19214@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=paolo.ciarrocchi@gmail.com \
    /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).