From: Jeff King <peff@peff.net>
To: Jeff Hostetler <git@jeffhostetler.com>
Cc: git@vger.kernel.org, gitster@pobox.com,
Jeff Hostetler <jeffhost@microsoft.com>
Subject: Re: [PATCH 2/4] stat_tracking_info: return +1 when branch and upstream differ
Date: Wed, 20 Dec 2017 11:14:07 -0500 [thread overview]
Message-ID: <20171220161407.GB31149@sigill.intra.peff.net> (raw)
In-Reply-To: <20171220144245.39401-3-git@jeffhostetler.com>
On Wed, Dec 20, 2017 at 02:42:43PM +0000, Jeff Hostetler wrote:
> Extend stat_tracking_info() to return 1 when the branch is
> not up to date with its upstream branch and only return 0
> when they are equal.
This means that callers all need to be updated, but there's no change
that the compiler could catch. You've updated all of the calls here, but
any topics in flight would need to be fixed, too.
I don't see any any in pu, but there are a number of long-running forks
hanging around these days.
Is it worth introducing a small change so that any other callers which
get merged in force a human to look at them? I'm wondering if we could
just re-order the "upstream_name" argument or something.
> --- a/remote.c
> +++ b/remote.c
> @@ -1983,7 +1983,9 @@ int ref_newer(const struct object_id *new_oid, const struct object_id *old_oid)
> * is not itself NULL.
> *
> * Returns -1 if num_ours and num_theirs could not be filled in (e.g., no
> - * upstream defined, or ref does not exist), 0 otherwise.
> + * upstream defined, or ref does not exist).
> + * Returns 0 if the commits are the same (the branch is up to date).
> + * Returns 1 if the commits are different (the branch is not up to date).
Slightly pedantic, but we'd return 1 here also if the branch is ahead of
its upstream, right?
-Peff
next prev parent reply other threads:[~2017-12-20 16:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-20 14:42 [PATCH 0/4] Add --no-ahead-behind to status Jeff Hostetler
2017-12-20 14:42 ` [PATCH 1/4] status: add --no-ahead-behind to porcelain V2 Jeff Hostetler
2017-12-20 16:07 ` Jeff King
2017-12-20 16:33 ` Jeff King
2017-12-20 19:44 ` Jeff Hostetler
2017-12-20 14:42 ` [PATCH 2/4] stat_tracking_info: return +1 when branch and upstream differ Jeff Hostetler
2017-12-20 16:14 ` Jeff King [this message]
2017-12-20 16:37 ` Jeff King
2017-12-21 14:06 ` Jeff Hostetler
2017-12-20 14:42 ` [PATCH 3/4] status: update short status to use --no-ahead-behind Jeff Hostetler
2017-12-20 16:26 ` Jeff King
2017-12-21 14:18 ` Jeff Hostetler
2017-12-21 15:39 ` Jeff King
2017-12-21 17:47 ` Jeff Hostetler
2017-12-20 14:42 ` [PATCH 4/4] status: support --no-ahead-behind in long status format Jeff Hostetler
2017-12-20 16:33 ` Jeff King
2017-12-20 16:43 ` [PATCH 0/4] Add --no-ahead-behind to status Jeff King
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=20171220161407.GB31149@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@jeffhostetler.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jeffhost@microsoft.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).