Code

Merge branch 'jp/dirty-describe'
authorJunio C Hamano <gitster@pobox.com>
Tue, 10 Nov 2009 20:30:43 +0000 (12:30 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 10 Nov 2009 20:30:43 +0000 (12:30 -0800)
* jp/dirty-describe:
  Teach "git describe" --dirty option

1  2 
Documentation/git-describe.txt
builtin-describe.c
t/t6120-describe.sh

Simple merge
index eaa8a9d229c97ebaab9ee3aa09d2456f68cd172c,7dbbee36accecfbfc9b592c9f7f35678ca24a515..390c14ec5953447bc2458ba8cc39d35373fdeb51
@@@ -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);
Simple merge