rev-list: drop unused void pointer from finish_commit()
[git/git.git] / builtin / rev-list.c
CommitLineData
64745109 1#include "cache.h"
b2141fc1 2#include "config.h"
64745109 3#include "commit.h"
c4e05b1a 4#include "diff.h"
ae563542 5#include "revision.h"
c64ed70d 6#include "list-objects.h"
caf3827e
JH
7#include "list-objects-filter.h"
8#include "list-objects-filter-options.h"
7c0fe330 9#include "object.h"
cbd53a21 10#include "object-store.h"
aa32939f
VM
11#include "pack.h"
12#include "pack-bitmap.h"
5fb61b8d 13#include "builtin.h"
50e62a8e 14#include "log-tree.h"
7fefda5c 15#include "graph.h"
a2ad79ce 16#include "bisect.h"
434ea3cd 17#include "progress.h"
7f97de5e 18#include "reflog-walk.h"
caf3827e 19#include "oidset.h"
df11e196 20#include "packfile.h"
3ae5fa07 21#include "object-store.h"
8906300f 22
a6f68d47 23static const char rev_list_usage[] =
1b1dd23f 24"git rev-list [OPTION] <commit-id>... [ -- paths... ]\n"
69e0c256 25" limiting output:\n"
62b4698e
ŠN
26" --max-count=<n>\n"
27" --max-age=<epoch>\n"
28" --min-age=<epoch>\n"
69e0c256
JH
29" --sparse\n"
30" --no-merges\n"
ad5aeede
MG
31" --min-parents=<n>\n"
32" --no-min-parents\n"
33" --max-parents=<n>\n"
34" --no-max-parents\n"
93b74bca 35" --remove-empty\n"
69e0c256 36" --all\n"
a5aa930d
UKK
37" --branches\n"
38" --tags\n"
39" --remotes\n"
42cabc34 40" --stdin\n"
27350891 41" --quiet\n"
69e0c256 42" ordering output:\n"
69e0c256 43" --topo-order\n"
4c8725f1 44" --date-order\n"
7ccd3667 45" --reverse\n"
69e0c256
JH
46" formatting output:\n"
47" --parents\n"
72276a3e 48" --children\n"
c6496575 49" --objects | --objects-edge\n"
69e0c256
JH
50" --unpacked\n"
51" --header | --pretty\n"
62b4698e 52" --abbrev=<n> | --no-abbrev\n"
5c51c985 53" --abbrev-commit\n"
b24bace5 54" --left-right\n"
75d2e5a7 55" --count\n"
69e0c256 56" special purpose:\n"
457f08a0 57" --bisect\n"
50e62a8e
CC
58" --bisect-vars\n"
59" --bisect-all"
69e0c256 60;
a6f68d47 61
434ea3cd
JK
62static struct progress *progress;
63static unsigned progress_counter;
64
caf3827e
JH
65static struct list_objects_filter_options filter_options;
66static struct oidset omitted_objects;
67static int arg_print_omitted; /* print objects omitted by filter */
68
69static struct oidset missing_objects;
70enum missing_action {
71 MA_ERROR = 0, /* fail if any missing objects are encountered */
72 MA_ALLOW_ANY, /* silently allow ALL missing objects */
73 MA_PRINT, /* print ALL missing objects in special section */
df11e196 74 MA_ALLOW_PROMISOR, /* silently allow all missing PROMISOR objects */
caf3827e
JH
75};
76static enum missing_action arg_missing_action;
77
78#define DEFAULT_OIDSET_SIZE (16*1024)
79
d92349dd 80static void finish_commit(struct commit *commit);
11c211fa 81static void show_commit(struct commit *commit, void *data)
81f2bb1f 82{
d797257e
CC
83 struct rev_list_info *info = data;
84 struct rev_info *revs = info->revs;
11c211fa 85
434ea3cd
JK
86 display_progress(progress, ++progress_counter);
87
98993722 88 if (info->flags & REV_LIST_QUIET) {
d92349dd 89 finish_commit(commit);
98993722
NTND
90 return;
91 }
92
11c211fa 93 graph_show_commit(revs->graph);
7fefda5c 94
f69c5018 95 if (revs->count) {
b388e14b
MG
96 if (commit->object.flags & PATCHSAME)
97 revs->count_same++;
98 else if (commit->object.flags & SYMMETRIC_LEFT)
f69c5018
TR
99 revs->count_left++;
100 else
101 revs->count_right++;
d92349dd 102 finish_commit(commit);
f69c5018
TR
103 return;
104 }
105
d797257e 106 if (info->show_timestamp)
cb71f8bd 107 printf("%"PRItime" ", commit->date);
d797257e
CC
108 if (info->header_prefix)
109 fputs(info->header_prefix, stdout);
7528f27d 110
1df2d656
MG
111 if (!revs->graph)
112 fputs(get_revision_mark(revs, commit), stdout);
11c211fa 113 if (revs->abbrev_commit && revs->abbrev)
aab9583f 114 fputs(find_unique_abbrev(&commit->object.oid, revs->abbrev),
7594c4b2 115 stdout);
5c51c985 116 else
f2fd0760 117 fputs(oid_to_hex(&commit->object.oid), stdout);
11c211fa 118 if (revs->print_parents) {
81f2bb1f
LT
119 struct commit_list *parents = commit->parents;
120 while (parents) {
f2fd0760 121 printf(" %s", oid_to_hex(&parents->item->object.oid));
81f2bb1f
LT
122 parents = parents->next;
123 }
124 }
11c211fa 125 if (revs->children.name) {
72276a3e
JH
126 struct commit_list *children;
127
11c211fa 128 children = lookup_decoration(&revs->children, &commit->object);
72276a3e 129 while (children) {
f2fd0760 130 printf(" %s", oid_to_hex(&children->item->object.oid));
72276a3e
JH
131 children = children->next;
132 }
133 }
11c211fa
CC
134 show_decorations(revs, commit);
135 if (revs->commit_format == CMIT_FMT_ONELINE)
d87449c5
JH
136 putchar(' ');
137 else
138 putchar('\n');
139
7fa31b64 140 if (revs->verbose_header) {
f285a2d7 141 struct strbuf buf = STRBUF_INIT;
dd2e794a
TR
142 struct pretty_print_context ctx = {0};
143 ctx.abbrev = revs->abbrev;
144 ctx.date_mode = revs->date_mode;
f026c756 145 ctx.date_mode_explicit = revs->date_mode_explicit;
6bf13944 146 ctx.fmt = revs->commit_format;
ecaee805 147 ctx.output_encoding = get_log_output_encoding();
d75dfb10 148 ctx.color = revs->diffopt.use_color;
6bf13944 149 pretty_print_commit(&ctx, commit, &buf);
660e113c
JK
150 if (buf.len) {
151 if (revs->commit_format != CMIT_FMT_ONELINE)
152 graph_show_oneline(revs->graph);
7fefda5c 153
660e113c 154 graph_show_commit_msg(revs->graph, stdout, &buf);
7fefda5c 155
660e113c
JK
156 /*
157 * Add a newline after the commit message.
158 *
159 * Usually, this newline produces a blank
160 * padding line between entries, in which case
161 * we need to add graph padding on this line.
162 *
163 * However, the commit message may not end in a
164 * newline. In this case the newline simply
165 * ends the last line of the commit message,
166 * and we don't need any graph output. (This
167 * always happens with CMIT_FMT_ONELINE, and it
168 * happens with CMIT_FMT_USERFORMAT when the
169 * format doesn't explicitly end in a newline.)
170 */
171 if (buf.len && buf.buf[buf.len - 1] == '\n')
172 graph_show_padding(revs->graph);
98985c69 173 putchar(info->hdr_termination);
7fefda5c 174 } else {
660e113c
JK
175 /*
176 * If the message buffer is empty, just show
177 * the rest of the graph output for this
178 * commit.
179 */
180 if (graph_show_remainder(revs->graph))
181 putchar('\n');
182 if (revs->commit_format == CMIT_FMT_ONELINE)
183 putchar('\n');
7fefda5c 184 }
674d1727 185 strbuf_release(&buf);
7fefda5c 186 } else {
11c211fa 187 if (graph_show_remainder(revs->graph))
7fefda5c 188 putchar('\n');
7620d39f 189 }
06f59e9f 190 maybe_flush_or_die(stdout, "stdout");
d92349dd 191 finish_commit(commit);
27350891
SP
192}
193
d92349dd 194static void finish_commit(struct commit *commit)
27350891 195{
cb115748
LT
196 if (commit->parents) {
197 free_commit_list(commit->parents);
198 commit->parents = NULL;
199 }
6a7895fd
SB
200 free_commit_buffer(the_repository->parsed_objects,
201 commit);
a3437b8c
JS
202}
203
caf3827e
JH
204static inline void finish_object__ma(struct object *obj)
205{
df11e196
JT
206 /*
207 * Whether or not we try to dynamically fetch missing objects
208 * from the server, we currently DO NOT have the object. We
209 * can either print, allow (ignore), or conditionally allow
210 * (ignore) them.
211 */
caf3827e
JH
212 switch (arg_missing_action) {
213 case MA_ERROR:
7c0fe330
MD
214 die("missing %s object '%s'",
215 type_name(obj->type), oid_to_hex(&obj->oid));
caf3827e
JH
216 return;
217
218 case MA_ALLOW_ANY:
219 return;
220
221 case MA_PRINT:
222 oidset_insert(&missing_objects, &obj->oid);
223 return;
224
df11e196
JT
225 case MA_ALLOW_PROMISOR:
226 if (is_promisor_object(&obj->oid))
227 return;
7c0fe330
MD
228 die("unexpected missing %s object '%s'",
229 type_name(obj->type), oid_to_hex(&obj->oid));
df11e196
JT
230 return;
231
caf3827e
JH
232 default:
233 BUG("unhandled missing_action");
234 return;
235 }
236}
237
df11e196 238static int finish_object(struct object *obj, const char *name, void *cb_data)
27350891 239{
98993722 240 struct rev_list_info *info = cb_data;
f06ab027 241 if (oid_object_info_extended(the_repository, &obj->oid, NULL, 0) < 0) {
caf3827e 242 finish_object__ma(obj);
df11e196
JT
243 return 1;
244 }
98993722 245 if (info->revs->verify_objects && !obj->parsed && obj->type != OBJ_COMMIT)
109cd76d 246 parse_object(the_repository, &obj->oid);
df11e196 247 return 0;
27350891
SP
248}
249
de1e67d0 250static void show_object(struct object *obj, const char *name, void *cb_data)
9de48752 251{
cb8da705 252 struct rev_list_info *info = cb_data;
df11e196
JT
253 if (finish_object(obj, name, cb_data))
254 return;
434ea3cd 255 display_progress(progress, ++progress_counter);
98993722
NTND
256 if (info->flags & REV_LIST_QUIET)
257 return;
de1e67d0 258 show_object_with_name(stdout, obj, name);
9de48752
LT
259}
260
8d1d8f83
JH
261static void show_edge(struct commit *commit)
262{
f2fd0760 263 printf("-%s\n", oid_to_hex(&commit->object.oid));
8d1d8f83
JH
264}
265
38ef7507 266static void print_var_str(const char *var, const char *val)
280e65cb 267{
38ef7507 268 printf("%s='%s'\n", var, val);
280e65cb
CC
269}
270
38ef7507 271static void print_var_int(const char *var, int val)
280e65cb 272{
38ef7507 273 printf("%s=%d\n", var, val);
280e65cb
CC
274}
275
f1c92c63 276static int show_bisect_vars(struct rev_list_info *info, int reaches, int all)
9996983c 277{
98993722 278 int cnt, flags = info->flags;
dc01505f 279 char hex[GIT_MAX_HEXSZ + 1] = "";
95188648 280 struct commit_list *tried;
d797257e 281 struct rev_info *revs = info->revs;
9996983c 282
8ba8fe04 283 if (!revs->commits)
9996983c
CC
284 return 1;
285
9af3589e
CC
286 revs->commits = filter_skipped(revs->commits, &tried,
287 flags & BISECT_SHOW_ALL,
288 NULL, NULL);
95188648 289
9996983c 290 /*
7428d754 291 * revs->commits can reach "reaches" commits among
9996983c
CC
292 * "all" commits. If it is good, then there are
293 * (all-reaches) commits left to be bisected.
294 * On the other hand, if it is bad, then the set
295 * to bisect is "reaches".
296 * A bisect set of size N has (N-1) commits further
297 * to test, as we already know one bad one.
298 */
299 cnt = all - reaches;
300 if (cnt < reaches)
301 cnt = reaches;
6a17fad7 302
95188648 303 if (revs->commits)
2490574d 304 oid_to_hex_r(hex, &revs->commits->item->object.oid);
9996983c 305
37c4c38d 306 if (flags & BISECT_SHOW_ALL) {
d797257e 307 traverse_commit_list(revs, show_commit, show_object, info);
9996983c
CC
308 printf("------\n");
309 }
310
38ef7507
CC
311 print_var_str("bisect_rev", hex);
312 print_var_int("bisect_nr", cnt - 1);
313 print_var_int("bisect_good", all - reaches - 1);
314 print_var_int("bisect_bad", reaches - 1);
315 print_var_int("bisect_all", all);
316 print_var_int("bisect_steps", estimate_bisect_steps(all));
9996983c
CC
317
318 return 0;
319}
320
aa32939f 321static int show_object_fast(
20664967 322 const struct object_id *oid,
aa32939f
VM
323 enum object_type type,
324 int exclude,
325 uint32_t name_hash,
326 struct packed_git *found_pack,
327 off_t found_offset)
328{
20664967 329 fprintf(stdout, "%s\n", oid_to_hex(oid));
aa32939f
VM
330 return 1;
331}
332
caf3827e
JH
333static inline int parse_missing_action_value(const char *value)
334{
335 if (!strcmp(value, "error")) {
336 arg_missing_action = MA_ERROR;
337 return 1;
338 }
339
340 if (!strcmp(value, "allow-any")) {
341 arg_missing_action = MA_ALLOW_ANY;
df11e196 342 fetch_if_missing = 0;
caf3827e
JH
343 return 1;
344 }
345
346 if (!strcmp(value, "print")) {
347 arg_missing_action = MA_PRINT;
df11e196
JT
348 fetch_if_missing = 0;
349 return 1;
350 }
351
352 if (!strcmp(value, "allow-promisor")) {
353 arg_missing_action = MA_ALLOW_PROMISOR;
354 fetch_if_missing = 0;
caf3827e
JH
355 return 1;
356 }
357
358 return 0;
359}
360
a633fca0 361int cmd_rev_list(int argc, const char **argv, const char *prefix)
64745109 362{
11c211fa 363 struct rev_info revs;
d797257e 364 struct rev_list_info info;
bbcde41a
MD
365 struct setup_revision_opt s_r_opt = {
366 .allow_exclude_promisor_objects = 1,
367 };
d9a83684 368 int i;
ff62d732 369 int bisect_list = 0;
457f08a0 370 int bisect_show_vars = 0;
50e62a8e 371 int bisect_find_all = 0;
aa32939f 372 int use_bitmap_index = 0;
434ea3cd 373 const char *show_progress = NULL;
64745109 374
5a88f97c
JH
375 if (argc == 2 && !strcmp(argv[1], "-h"))
376 usage(rev_list_usage);
377
ef90d6d4 378 git_config(git_default_config, NULL);
2abf3503 379 repo_init_revisions(the_repository, &revs, prefix);
7337b138 380 revs.abbrev = DEFAULT_ABBREV;
7594c4b2 381 revs.commit_format = CMIT_FMT_UNSPECIFIED;
df11e196
JT
382
383 /*
384 * Scan the argument list before invoking setup_revisions(), so that we
385 * know if fetch_if_missing needs to be set to 0.
386 *
387 * "--exclude-promisor-objects" acts as a pre-filter on missing objects
388 * by not crossing the boundary from realized objects to promisor
389 * objects.
390 *
391 * Let "--missing" to conditionally set fetch_if_missing.
392 */
393 for (i = 1; i < argc; i++) {
394 const char *arg = argv[i];
395 if (!strcmp(arg, "--exclude-promisor-objects")) {
396 fetch_if_missing = 0;
397 revs.exclude_promisor_objects = 1;
398 break;
399 }
400 }
401 for (i = 1; i < argc; i++) {
402 const char *arg = argv[i];
403 if (skip_prefix(arg, "--missing=", &arg)) {
404 if (revs.exclude_promisor_objects)
405 die(_("cannot combine --exclude-promisor-objects and --missing"));
406 if (parse_missing_action_value(arg))
407 break;
408 }
409 }
410
ee4dfee2
JK
411 if (arg_missing_action)
412 revs.do_not_die_on_missing_tree = 1;
413
bbcde41a 414 argc = setup_revisions(argc, argv, &revs, &s_r_opt);
ae563542 415
d797257e
CC
416 memset(&info, 0, sizeof(info));
417 info.revs = &revs;
ad3f9a71
LT
418 if (revs.bisect)
419 bisect_list = 1;
d797257e 420
0d1e0e78 421 if (revs.diffopt.flags.quick)
98993722 422 info.flags |= REV_LIST_QUIET;
fcfda02b 423 for (i = 1 ; i < argc; i++) {
cf484544 424 const char *arg = argv[i];
fcfda02b 425
a6f68d47 426 if (!strcmp(arg, "--header")) {
7594c4b2 427 revs.verbose_header = 1;
9d97aa64
LT
428 continue;
429 }
dc68c4ff 430 if (!strcmp(arg, "--timestamp")) {
d797257e 431 info.show_timestamp = 1;
dc68c4ff
JH
432 continue;
433 }
8b3a1e05
LT
434 if (!strcmp(arg, "--bisect")) {
435 bisect_list = 1;
436 continue;
437 }
50e62a8e
CC
438 if (!strcmp(arg, "--bisect-all")) {
439 bisect_list = 1;
440 bisect_find_all = 1;
98993722 441 info.flags |= BISECT_SHOW_ALL;
6e46cc0d 442 revs.show_decorations = 1;
50e62a8e
CC
443 continue;
444 }
457f08a0
JH
445 if (!strcmp(arg, "--bisect-vars")) {
446 bisect_list = 1;
447 bisect_show_vars = 1;
448 continue;
449 }
aa32939f
VM
450 if (!strcmp(arg, "--use-bitmap-index")) {
451 use_bitmap_index = 1;
452 continue;
453 }
454 if (!strcmp(arg, "--test-bitmap")) {
455 test_bitmap_walk(&revs);
456 return 0;
457 }
434ea3cd
JK
458 if (skip_prefix(arg, "--progress=", &arg)) {
459 show_progress = arg;
460 continue;
461 }
caf3827e
JH
462
463 if (skip_prefix(arg, ("--" CL_ARG__FILTER "="), &arg)) {
464 parse_list_objects_filter(&filter_options, arg);
465 if (filter_options.choice && !revs.blob_objects)
466 die(_("object filtering requires --objects"));
467 if (filter_options.choice == LOFC_SPARSE_OID &&
468 !filter_options.sparse_oid_value)
469 die(_("invalid sparse value '%s'"),
470 filter_options.filter_spec);
471 continue;
472 }
f4371a88 473 if (!strcmp(arg, ("--no-" CL_ARG__FILTER))) {
aa57b871 474 list_objects_filter_set_no_filter(&filter_options);
f4371a88
JH
475 continue;
476 }
caf3827e
JH
477 if (!strcmp(arg, "--filter-print-omitted")) {
478 arg_print_omitted = 1;
479 continue;
480 }
481
df11e196
JT
482 if (!strcmp(arg, "--exclude-promisor-objects"))
483 continue; /* already handled above */
484 if (skip_prefix(arg, "--missing=", &arg))
485 continue; /* already handled above */
caf3827e 486
ae563542 487 usage(rev_list_usage);
a6f68d47 488
fcfda02b 489 }
7594c4b2
JH
490 if (revs.commit_format != CMIT_FMT_UNSPECIFIED) {
491 /* The command line has a --pretty */
d797257e 492 info.hdr_termination = '\n';
7594c4b2 493 if (revs.commit_format == CMIT_FMT_ONELINE)
d797257e 494 info.header_prefix = "";
7594c4b2 495 else
d797257e 496 info.header_prefix = "commit ";
7594c4b2 497 }
db89665f
JH
498 else if (revs.verbose_header)
499 /* Only --header was specified */
500 revs.commit_format = CMIT_FMT_RAW;
fcfda02b 501
7f97de5e 502 if ((!revs.commits && reflog_walk_empty(revs.reflog_info) &&
c01499ef 503 (!(revs.tag_objects || revs.tree_objects || revs.blob_objects) &&
0159ba32 504 !revs.pending.nr) &&
a12cbe23 505 !revs.rev_input_given && !revs.read_from_stdin) ||
8c1f0b44 506 revs.diff)
7b34c2fa
LT
507 usage(rev_list_usage);
508
2aea7a51
JK
509 if (revs.show_notes)
510 die(_("rev-list does not support display of notes"));
511
caf3827e
JH
512 if (filter_options.choice && use_bitmap_index)
513 die(_("cannot combine --use-bitmap-index with object filtering"));
514
80235ba7
JH
515 save_commit_buffer = (revs.verbose_header ||
516 revs.grep_filter.pattern_list ||
517 revs.grep_filter.header_list);
4e1dc640
JH
518 if (bisect_list)
519 revs.limited = 1;
9181ca2c 520
434ea3cd 521 if (show_progress)
8aade107 522 progress = start_delayed_progress(show_progress, 0);
434ea3cd 523
c8a70d35 524 if (use_bitmap_index && !revs.prune) {
aa32939f
VM
525 if (revs.count && !revs.left_right && !revs.cherry_mark) {
526 uint32_t commit_count;
5c9f9bf3 527 int max_count = revs.max_count;
3ae5fa07
JT
528 struct bitmap_index *bitmap_git;
529 if ((bitmap_git = prepare_bitmap_walk(&revs))) {
530 count_bitmap_commit_list(bitmap_git, &commit_count, NULL, NULL, NULL);
5c9f9bf3
JK
531 if (max_count >= 0 && max_count < commit_count)
532 commit_count = max_count;
aa32939f 533 printf("%d\n", commit_count);
f3c23db2 534 free_bitmap_index(bitmap_git);
aa32939f
VM
535 return 0;
536 }
fb85db84
JK
537 } else if (revs.max_count < 0 &&
538 revs.tag_objects && revs.tree_objects && revs.blob_objects) {
3ae5fa07
JT
539 struct bitmap_index *bitmap_git;
540 if ((bitmap_git = prepare_bitmap_walk(&revs))) {
541 traverse_bitmap_commit_list(bitmap_git, &show_object_fast);
f3c23db2 542 free_bitmap_index(bitmap_git);
aa32939f
VM
543 return 0;
544 }
545 }
546 }
547
3d51e1b5
MK
548 if (prepare_revision_walk(&revs))
549 die("revision walk setup failed");
a4a88b2b 550 if (revs.tree_objects)
4f6d26b1 551 mark_edges_uninteresting(&revs, show_edge, 0);
a4a88b2b 552
457f08a0 553 if (bisect_list) {
156e1782 554 int reaches, all;
457f08a0 555
24d707f6 556 find_bisection(&revs.commits, &reaches, &all, bisect_find_all);
95188648 557
9996983c 558 if (bisect_show_vars)
13858e57 559 return show_bisect_vars(&info, reaches, all);
457f08a0 560 }
7b34c2fa 561
caf3827e
JH
562 if (arg_print_omitted)
563 oidset_init(&omitted_objects, DEFAULT_OIDSET_SIZE);
564 if (arg_missing_action == MA_PRINT)
565 oidset_init(&missing_objects, DEFAULT_OIDSET_SIZE);
566
567 traverse_commit_list_filtered(
568 &filter_options, &revs, show_commit, show_object, &info,
569 (arg_print_omitted ? &omitted_objects : NULL));
570
571 if (arg_print_omitted) {
572 struct oidset_iter iter;
573 struct object_id *oid;
574 oidset_iter_init(&omitted_objects, &iter);
575 while ((oid = oidset_iter_next(&iter)))
576 printf("~%s\n", oid_to_hex(oid));
577 oidset_clear(&omitted_objects);
578 }
579 if (arg_missing_action == MA_PRINT) {
580 struct oidset_iter iter;
581 struct object_id *oid;
582 oidset_iter_init(&missing_objects, &iter);
583 while ((oid = oidset_iter_next(&iter)))
584 printf("?%s\n", oid_to_hex(oid));
585 oidset_clear(&missing_objects);
586 }
8906300f 587
434ea3cd
JK
588 stop_progress(&progress);
589
f69c5018 590 if (revs.count) {
b388e14b
MG
591 if (revs.left_right && revs.cherry_mark)
592 printf("%d\t%d\t%d\n", revs.count_left, revs.count_right, revs.count_same);
593 else if (revs.left_right)
f69c5018 594 printf("%d\t%d\n", revs.count_left, revs.count_right);
b388e14b
MG
595 else if (revs.cherry_mark)
596 printf("%d\t%d\n", revs.count_left + revs.count_right, revs.count_same);
f69c5018
TR
597 else
598 printf("%d\n", revs.count_left + revs.count_right);
599 }
600
64745109
LT
601 return 0;
602}