git-format-patch should show the correct version
[git.git] / show-branch.c
index bff690d..3fe62b7 100644 (file)
@@ -5,7 +5,7 @@
 #include "refs.h"
 
 static const char show_branch_usage[] =
-"git-show-branch [--all] [--heads] [--tags] [--more=count | --list | --independent | --merge-base ] [<refs>...]";
+"git-show-branch [--all] [--heads] [--tags] [--topo-order] [--more=count | --list | --independent | --merge-base ] [<refs>...]";
 
 #define UNINTERESTING  01
 
@@ -55,7 +55,7 @@ static void name_commit(struct commit *commit, const char *head_name, int nth)
 
 /* Parent is the first parent of the commit.  We may name it
  * as (n+1)th generation ancestor of the same head_name as
- * commit is nth generation ancestore of, if that generation
+ * commit is nth generation ancestor of, if that generation
  * number is better than the name it already has.
  */
 static void name_parent(struct commit *commit, struct commit *parent)
@@ -303,7 +303,7 @@ static int append_ref(const char *refname, const unsigned char *sha1)
                return 0;
        if (MAX_REVS <= ref_name_cnt) {
                fprintf(stderr, "warning: ignoring %s; "
-                       "cannot handle more than %d refs",
+                       "cannot handle more than %d refs\n",
                        refname, MAX_REVS);
                return 0;
        }
@@ -450,6 +450,8 @@ static void append_one_rev(const char *av)
                if (saved_matches == ref_name_cnt &&
                    ref_name_cnt < MAX_REVS)
                        error("no matching refs with %s", av);
+               if (saved_matches + 1 < ref_name_cnt)
+                       sort_ref_range(saved_matches, ref_name_cnt);
                return;
        }
        die("bad sha1 reference %s", av);
@@ -535,7 +537,7 @@ int main(int ac, char **av)
                if (MAX_REVS <= num_rev)
                        die("cannot handle more than %d revs.", MAX_REVS);
                if (get_sha1(ref_name[num_rev], revkey))
-                       die("'%s' is not a valid ref.\n", ref_name[num_rev]);
+                       die("'%s' is not a valid ref.", ref_name[num_rev]);
                commit = lookup_commit_reference(revkey);
                if (!commit)
                        die("cannot find commit %s (%s)",