From: Junio C Hamano Date: Sun, 7 Mar 2010 22:53:35 +0000 (-0800) Subject: Merge branch 'cc/maint-bisect-paths' into maint-1.6.6 X-Git-Tag: v1.7.0.3~33^2~7 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/7f43e75adc1c238f27a89b4e7a30a1c874fd01f9?ds=inline;hp=-c Merge branch 'cc/maint-bisect-paths' into maint-1.6.6 * cc/maint-bisect-paths: bisect: error out when passing bad path parameters --- 7f43e75adc1c238f27a89b4e7a30a1c874fd01f9 diff --combined bisect.c index b779a9589a,88881f7b6e..e4214c9909 --- a/bisect.c +++ b/bisect.c @@@ -956,7 -956,7 +956,7 @@@ int bisect_next_all(const char *prefix { struct rev_info revs; struct commit_list *tried; - int reaches = 0, all = 0, nr; + int reaches = 0, all = 0, nr, steps; const unsigned char *bisect_rev; char bisect_rev_hex[41]; @@@ -986,6 -986,12 +986,12 @@@ exit(1); } + if (!all) { + fprintf(stderr, "No testable commit found.\n" + "Maybe you started with bad path parameters?\n"); + exit(4); + } + bisect_rev = revs.commits->item->object.sha1; memcpy(bisect_rev_hex, sha1_to_hex(bisect_rev), 41); @@@ -998,10 -1004,8 +1004,10 @@@ } nr = all - reaches - 1; - printf("Bisecting: %d revisions left to test after this " - "(roughly %d steps)\n", nr, estimate_bisect_steps(all)); + steps = estimate_bisect_steps(all); + printf("Bisecting: %d revision%s left to test after this " + "(roughly %d step%s)\n", nr, (nr == 1 ? "" : "s"), + steps, (steps == 1 ? "" : "s")); return bisect_checkout(bisect_rev_hex); }