@matheusbsbs / matheus-bagliano / commits / 19de5d6913
Fork 0

stat_tracking_info(): only count real commits

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>

Kjetil Barvik committed Mar 4, 2009 at 18:47 UTC 19de5d6913b9681d2bde533bccc8445c9236a648
1 file changed +2 -1
remote.c
+2 -1
@@ -1310,9 +1310,10 @@ int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs)
1310 if (theirs == ours)
1311 return 0;
1312
1313 - /* Run "rev-list --left-right ours...theirs" internally... */
1313 + /* Run "rev-list --no-merges --left-right ours...theirs" internally... */
1314 rev_argc = 0;
1315 rev_argv[rev_argc++] = NULL;
1316 + rev_argv[rev_argc++] = "--no-merges";
1317 rev_argv[rev_argc++] = "--left-right";
1318 rev_argv[rev_argc++] = symmetric;
1319 rev_argv[rev_argc++] = "--";