author | Junio C Hamano <gitster@pobox.com> | |
Tue, 10 Nov 2009 20:30:43 +0000 (12:30 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 10 Nov 2009 20:30:43 +0000 (12:30 -0800) |
* jp/dirty-describe:
Teach "git describe" --dirty option
Teach "git describe" --dirty option
1 | 2 | |||
---|---|---|---|---|
Documentation/git-describe.txt | patch | | diff1 | | diff2 | | blob | history |
builtin-describe.c | patch | | diff1 | | diff2 | | blob | history |
t/t6120-describe.sh | patch | | diff1 | | diff2 | | blob | history |
diff --cc Documentation/git-describe.txt
Simple merge
diff --cc builtin-describe.c
index eaa8a9d229c97ebaab9ee3aa09d2456f68cd172c,7dbbee36accecfbfc9b592c9f7f35678ca24a515..390c14ec5953447bc2458ba8cc39d35373fdeb51
--- 1/builtin-describe.c
--- 2/builtin-describe.c
+++ b/builtin-describe.c
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);
diff --cc t/t6120-describe.sh
Simple merge