|
9 | 9 | #include "log-tree.h"
|
10 | 10 | #include "graph.h"
|
11 | 11 | #include "bisect.h"
|
| 12 | +#include "progress.h" |
12 | 13 |
|
13 | 14 | static const char rev_list_usage[] =
|
14 | 15 | "git rev-list [OPTION] <commit-id>... [ -- paths... ]\n"
|
@@ -49,12 +50,17 @@ static const char rev_list_usage[] =
|
49 | 50 | " --bisect-all"
|
50 | 51 | ;
|
51 | 52 |
|
| 53 | +static struct progress *progress; |
| 54 | +static unsigned progress_counter; |
| 55 | + |
52 | 56 | static void finish_commit(struct commit *commit, void *data);
|
53 | 57 | static void show_commit(struct commit *commit, void *data)
|
54 | 58 | {
|
55 | 59 | struct rev_list_info *info = data;
|
56 | 60 | struct rev_info *revs = info->revs;
|
57 | 61 |
|
| 62 | + display_progress(progress, ++progress_counter); |
| 63 | + |
58 | 64 | if (info->flags & REV_LIST_QUIET) {
|
59 | 65 | finish_commit(commit, data);
|
60 | 66 | return;
|
@@ -190,6 +196,7 @@ static void show_object(struct object *obj, const char *name, void *cb_data)
|
190 | 196 | {
|
191 | 197 | struct rev_list_info *info = cb_data;
|
192 | 198 | finish_object(obj, name, cb_data);
|
| 199 | + display_progress(progress, ++progress_counter); |
193 | 200 | if (info->flags & REV_LIST_QUIET)
|
194 | 201 | return;
|
195 | 202 | show_object_with_name(stdout, obj, name);
|
@@ -276,6 +283,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
|
276 | 283 | int bisect_show_vars = 0;
|
277 | 284 | int bisect_find_all = 0;
|
278 | 285 | int use_bitmap_index = 0;
|
| 286 | + const char *show_progress = NULL; |
279 | 287 |
|
280 | 288 | git_config(git_default_config, NULL);
|
281 | 289 | init_revisions(&revs, prefix);
|
@@ -325,6 +333,10 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
|
325 | 333 | test_bitmap_walk(&revs);
|
326 | 334 | return 0;
|
327 | 335 | }
|
| 336 | + if (skip_prefix(arg, "--progress=", &arg)) { |
| 337 | + show_progress = arg; |
| 338 | + continue; |
| 339 | + } |
328 | 340 | usage(rev_list_usage);
|
329 | 341 |
|
330 | 342 | }
|
@@ -355,6 +367,9 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
|
355 | 367 | if (bisect_list)
|
356 | 368 | revs.limited = 1;
|
357 | 369 |
|
| 370 | + if (show_progress) |
| 371 | + progress = start_progress_delay(show_progress, 0, 0, 2); |
| 372 | + |
358 | 373 | if (use_bitmap_index && !revs.prune) {
|
359 | 374 | if (revs.count && !revs.left_right && !revs.cherry_mark) {
|
360 | 375 | uint32_t commit_count;
|
@@ -392,6 +407,8 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
|
392 | 407 |
|
393 | 408 | traverse_commit_list(&revs, show_commit, show_object, &info);
|
394 | 409 |
|
| 410 | + stop_progress(&progress); |
| 411 | + |
395 | 412 | if (revs.count) {
|
396 | 413 | if (revs.left_right && revs.cherry_mark)
|
397 | 414 | printf("%d\t%d\t%d\n", revs.count_left, revs.count_right, revs.count_same);
|
|
0 commit comments