git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 2/5] stat_tracking_info: return +1 when branches are not equal

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Dec 21, 2017, 20:48 UTC
Message-ID
<20171221204838.GB58971@aiede.mtv.corp.google.com>
In-Reply-To
<20171221190909.62995-3-git@jeffhostetler.com>
Jeff Hostetler wrote:
Show 8 quoted lines
> --- a/ref-filter.c
> +++ b/ref-filter.c
> @@ -1239,7 +1239,7 @@ static void fill_remote_ref_details(struct used_atom *atom, const char *refname,
>  		*s = show_ref(&atom->u.remote_ref.refname, refname);
>  	else if (atom->u.remote_ref.option == RR_TRACK) {
>  		if (stat_tracking_info(branch, &num_ours,
> -				       &num_theirs, NULL)) {
> +				       &num_theirs, NULL, ABF_FULL) < 0) {
What does ABF stand for?  It made me think of airport codes.
Would a name like AHEADBEHIND_FULL work?
[...]
Show 14 quoted lines
> --- a/remote.c
> +++ b/remote.c
> @@ -1977,16 +1977,22 @@ int ref_newer(const struct object_id *new_oid, const struct object_id *old_oid)
>  }
>  
>  /*
> - * Compare a branch with its upstream, and save their differences (number
> - * of commits) in *num_ours and *num_theirs. The name of the upstream branch
> - * (or NULL if no upstream is defined) is returned via *upstream_name, if it
> - * is not itself NULL.
> + * Compare a branch with its upstream and report on their differences.
> + * If abf is ABF_FULL, save their differences (number of commits) in
> + * *num_ours and *num_theirs.
> + * If abf is ABF_QUICK, skip the (possibly expensive) ahead/behind

Please format these comments as paragraphs, with a consistent line-width and a "blank" (space-star-newline) line between paragraphs. That makes them much easier to read.

[...]
Show 6 quoted lines
> @@ -2019,6 +2025,8 @@ int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs,
>  		*num_theirs = *num_ours = 0;
>  		return 0;
>  	}
> +	if (abf == ABF_QUICK)
> +		return 1;
nit: I think this is missing a blank line before the 'if'.

Thanks and hope that helps, Jonathan

Previous: Jeff Hostetler
Message 20 of 20 in “Add --no-ahead-behind to status”
  1. 0/5 Add --no-ahead-behind to statusJeff Hostetler, Dec 21, 2017
  2. 1/5 core.aheadbehind: add new config settingJeff Hostetler, Dec 21, 2017
  3. Igor DjordjevicDec 21, 2017
  4. Jonathan NiederDec 21, 2017
  5. Junio C HamanoDec 22, 2017
  6. Jeff KingDec 24, 2017
  7. Junio C HamanoDec 27, 2017
  8. Jeff KingJan 4, 2018
  9. Lars SchneiderApr 3, 2018
  10. Ævar Arnfjörð BjarmasonApr 3, 2018
  11. Derrick StoleeApr 3, 2018
  12. Jeff HostetlerApr 3, 2018
  13. Jeff HostetlerJan 2, 2018
  14. Jonathan NiederJan 2, 2018
  15. 3/5 status: add --[no-]ahead-behind to porcelain V2 outputJeff Hostetler, Dec 21, 2017
  16. Jonathan NiederDec 21, 2017
  17. 4/5 status: update short status to use --no-ahead-behindJeff Hostetler, Dec 21, 2017
  18. 5/5 status: support --no-ahead-behind in long formatJeff Hostetler, Dec 21, 2017
  19. 2/5 stat_tracking_info: return +1 when branches are not equalJeff Hostetler, Dec 21, 2017
  20. Jonathan NiederDec 21, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.