Skip to content

Commit

Permalink
stat_tracking_info(): only count real commits
Browse files Browse the repository at this point in the history
stat_tracking_info() in remote.c is used to collect the statistics to
be able to say (for instance) from the output of "git checkout':

  Your branch and 'foo' have diverged,
  and have X and Y different commit(s) each, respectively.

Currently X and Y also includes the count of merges.  This patch
excludes the merges from being counted.

Signed-off-by: Kjetil Barvik <barvik@broadpark.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Kjetil Barvik authored and Junio C Hamano committed Mar 5, 2009
1 parent a95148d commit 19de5d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -1310,9 +1310,10 @@ int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs)
if (theirs == ours)
return 0;

/* Run "rev-list --left-right ours...theirs" internally... */
/* Run "rev-list --no-merges --left-right ours...theirs" internally... */
rev_argc = 0;
rev_argv[rev_argc++] = NULL;
rev_argv[rev_argc++] = "--no-merges";
rev_argv[rev_argc++] = "--left-right";
rev_argv[rev_argc++] = symmetric;
rev_argv[rev_argc++] = "--";
Expand Down

0 comments on commit 19de5d6

Please sign in to comment.