Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Sat, 24 Oct 2009 05:40:18 +0000 (22:40 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 24 Oct 2009 05:40:18 +0000 (22:40 -0700)
* maint:
Fix list of released versions in the toc document
Do not fail "describe --always" in a tag-less repository

1  2 
Documentation/git.txt
builtin-describe.c
diff --combined Documentation/git.txt
index df46a3437197612a03d9d3f16c4fedf00af3cd16,8519928d4592c1f7abc20f75a62866b756611510..10f2f82ca179c36bcb54ba938e92ba4858a127f6
@@@ -10,7 -10,7 +10,7 @@@ SYNOPSI
  --------
  [verse]
  'git' [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]
 -    [-p|--paginate|--no-pager]
 +    [-p|--paginate|--no-pager] [--no-replace-objects]
      [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]
      [--help] COMMAND [ARGS]
  
@@@ -43,7 -43,7 +43,7 @@@ unreleased) version of git, that is ava
  branch of the `git.git` repository.
  Documentation for older releases are available here:
  
- * link:v1.6.5/git.html[documentation for release 1.6.5]
+ * link:v1.6.5.1/git.html[documentation for release 1.6.5.1]
  
  * release notes for
    link:RelNotes-1.6.5.1.txt[1.6.5.1],
@@@ -238,10 -238,6 +238,10 @@@ help ...`
        environment is not set, it is set to the current working
        directory.
  
 +--no-replace-objects::
 +      Do not use replacement refs to replace git objects. See
 +      linkgit:git-replace[1] for more information.
 +
  
  FURTHER DOCUMENTATION
  ---------------------
diff --combined builtin-describe.c
index 2dcfd3dfebdaad8fe87b8d09fa00b058f519ac5a,7542b5705c4e0f3d214d3f3ff7367ee03bf82b9f..eaa8a9d229c97ebaab9ee3aa09d2456f68cd172c
@@@ -180,6 -180,7 +180,6 @@@ static void describe(const char *arg, i
        unsigned char sha1[20];
        struct commit *cmit, *gave_up_on = NULL;
        struct commit_list *list;
 -      static int initialized = 0;
        struct commit_name *n;
        struct possible_tag all_matches[MAX_TAGS];
        unsigned int match_cnt = 0, annotated_cnt = 0, cur_match;
        if (!cmit)
                die("%s is not a valid '%s' object", arg, commit_type);
  
 -      if (!initialized) {
 -              initialized = 1;
 -              for_each_ref(get_name, NULL);
 -      }
 -
 -      if (!found_names && !always)
 -              die("cannot describe '%s'", sha1_to_hex(sha1));
 -
        n = cmit->util;
        if (n) {
                /*
@@@ -350,10 -359,6 +350,10 @@@ int cmd_describe(int argc, const char *
                return cmd_name_rev(i + argc, args, prefix);
        }
  
-       if (!found_names)
 +      for_each_ref(get_name, NULL);
++      if (!found_names && !always)
 +              die("No names found, cannot describe anything.");
 +
        if (argc == 0) {
                describe("HEAD", 1);
        } else {