From: Junio C Hamano Date: Tue, 10 Nov 2009 20:30:43 +0000 (-0800) Subject: Merge branch 'jp/dirty-describe' X-Git-Tag: v1.6.6-rc0~66 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=48cbf915a4738097f291de06e23d293f79ff3f9e;p=git.git Merge branch 'jp/dirty-describe' * jp/dirty-describe: Teach "git describe" --dirty option --- 48cbf915a4738097f291de06e23d293f79ff3f9e diff --cc builtin-describe.c index eaa8a9d22,7dbbee36a..390c14ec5 --- a/builtin-describe.c +++ b/builtin-describe.c @@@ -350,12 -378,12 +369,16 @@@ int cmd_describe(int argc, const char * return cmd_name_rev(i + argc, args, prefix); } + for_each_ref(get_name, NULL); + if (!found_names && !always) + die("No names found, cannot describe anything."); + if (argc == 0) { + if (dirty && !cmd_diff_index(ARRAY_SIZE(diff_index_args) - 1, diff_index_args, prefix)) + dirty = NULL; describe("HEAD", 1); + } else if (dirty) { + die("--dirty is incompatible with committishes"); } else { while (argc-- > 0) { describe(*argv++, argc == 0);