Merge branch 'ah/usage-strings' into maint
authorJunio C Hamano <gitster@pobox.com>
Tue, 16 Jun 2015 21:33:50 +0000 (14:33 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 Jun 2015 21:33:50 +0000 (14:33 -0700)
A few usage string updates.

* ah/usage-strings:
blame, log: format usage strings similarly to those in documentation

1  2 
builtin/blame.c
diff --combined builtin/blame.c
index ff978253f1fb3d72ff3add9d2718aa3611697b4a,5710dcbec6c64ec04fb1d073c7c4e3277c3ccfbf..b3e948e757e97947211f598488339cd4f03c43eb
@@@ -26,9 -26,8 +26,9 @@@
  #include "userdiff.h"
  #include "line-range.h"
  #include "line-log.h"
 +#include "dir.h"
  
- static char blame_usage[] = N_("git blame [<options>] [<rev-opts>] [<rev>] [--] file");
+ static char blame_usage[] = N_("git blame [<options>] [<rev-opts>] [<rev>] [--] <file>");
  
  static const char *blame_opt_usage[] = {
        blame_usage,
@@@ -2086,6 -2085,7 +2086,6 @@@ static void find_alignment(struct score
  
        for (e = sb->ent; e; e = e->next) {
                struct origin *suspect = e->suspect;
 -              struct commit_info ci;
                int num;
  
                if (compute_auto_abbrev)
                if (longest_file < num)
                        longest_file = num;
                if (!(suspect->commit->object.flags & METAINFO_SHOWN)) {
 +                      struct commit_info ci;
                        suspect->commit->object.flags |= METAINFO_SHOWN;
                        get_commit_info(suspect->commit, &ci, 1);
                        if (*option & OUTPUT_SHOW_EMAIL)
                                num = utf8_strwidth(ci.author.buf);
                        if (longest_author < num)
                                longest_author = num;
 +                      commit_info_destroy(&ci);
                }
                num = e->s_lno + e->num_lines;
                if (longest_src_lines < num)
                        longest_dst_lines = num;
                if (largest_score < ent_score(sb, e))
                        largest_score = ent_score(sb, e);
 -
 -              commit_info_destroy(&ci);
        }
        max_orig_digits = decimal_width(longest_src_lines);
        max_digits = decimal_width(longest_dst_lines);
@@@ -2152,6 -2152,16 +2152,6 @@@ static void sanity_check_refcnt(struct 
        }
  }
  
 -/*
 - * Used for the command line parsing; check if the path exists
 - * in the working tree.
 - */
 -static int has_string_in_work_tree(const char *path)
 -{
 -      struct stat st;
 -      return !lstat(path, &st);
 -}
 -
  static unsigned parse_score(const char *arg)
  {
        char *end;
@@@ -2339,7 -2349,6 +2339,7 @@@ static struct commit *fake_working_tree
                if (strbuf_read(&buf, 0, 0) < 0)
                        die_errno("failed to read from stdin");
        }
 +      convert_to_git(path, buf.buf, buf.len, &buf, 0);
        origin->file.ptr = buf.buf;
        origin->file.size = buf.len;
        pretend_sha1_file(buf.buf, buf.len, OBJ_BLOB, origin->blob_sha1);
@@@ -2647,14 -2656,14 +2647,14 @@@ parse_done
                if (argc < 2)
                        usage_with_options(blame_opt_usage, options);
                path = add_prefix(prefix, argv[argc - 1]);
 -              if (argc == 3 && !has_string_in_work_tree(path)) { /* (2b) */
 +              if (argc == 3 && !file_exists(path)) { /* (2b) */
                        path = add_prefix(prefix, argv[1]);
                        argv[1] = argv[2];
                }
                argv[argc - 1] = "--";
  
                setup_work_tree();
 -              if (!has_string_in_work_tree(path))
 +              if (!file_exists(path))
                        die_errno("cannot stat path '%s'", path);
        }