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:37:11 -0500 [thread overview]
Message-ID: <20171220163711.GA5551@sigill.intra.peff.net> (raw)
In-Reply-To: <20171220161407.GB31149@sigill.intra.peff.net>
On Wed, Dec 20, 2017 at 11:14:07AM -0500, Jeff King wrote:
> 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.
Having seen the change in the next patch, I wonder if we should add a
flag field to specify "don't bother doing extra work" rather than
passing NULL for the ours/theirs parameters. I.e., most callers would
become:
if (stat_tracking_info(branch, &ours, &theirs, &base, 0) >= 0)
and the ones you touch later in the series would become:
if (stat_tracking_info(branch, NULL, NULL, &base, TRACKING_QUICK) >= 0)
or similar. And then any newly added calls would get flagged by the
compiler as missing the final parameter.
-Peff
next prev parent reply other threads:[~2017-12-20 16:37 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
2017-12-20 16:37 ` Jeff King [this message]
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=20171220163711.GA5551@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).