X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=blame.c;h=7099b53c72dd3d4f586b6ae4ba7583738225523c;hb=640ce1052bbd6a8f1dd4d58beaa521d7592a0f02;hp=c86e2fd4b31fc75adf1c315fda166aabc38f0f43;hpb=275fb96ae65b0886d9e6e93a421453eb6d13cb9f;p=git.git diff --git a/blame.c b/blame.c index c86e2fd4b..7099b53c7 100644 --- a/blame.c +++ b/blame.c @@ -20,12 +20,12 @@ #define DEBUG 0 -static const char blame_usage[] = "[-c] [-l] [-t] [-S ] [--] file [commit]\n" - " -c, --compability Use the same output mode as git-annotate (Default: off)\n" - " -l, --long Show long commit SHA1 (Default: off)\n" - " -t, --time Show raw timestamp (Default: off)\n" - " -S, --revs-file Use revisions from revs-file instead of calling git-rev-list\n" - " -h, --help This message"; +static const char blame_usage[] = "git-blame [-c] [-l] [-t] [-S ] [--] file [commit]\n" + " -c, --compatibility Use the same output mode as git-annotate (Default: off)\n" + " -l, --long Show long commit SHA1 (Default: off)\n" + " -t, --time Show raw timestamp (Default: off)\n" + " -S, --revs-file Use revisions from revs-file instead of calling git-rev-list\n" + " -h, --help This message"; static struct commit **blame_lines; static int num_blame_lines; @@ -44,8 +44,8 @@ struct util_info { }; struct chunk { - int off1, len1; // --- - int off2, len2; // +++ + int off1, len1; /* --- */ + int off2, len2; /* +++ */ }; struct patch { @@ -255,7 +255,7 @@ static void print_map(struct commit *cmit, struct commit *other) } #endif -// p is a patch from commit to other. +/* p is a patch from commit to other. */ static void fill_line_map(struct commit *commit, struct commit *other, struct patch *p) { @@ -747,7 +747,7 @@ int main(int argc, const char **argv) const char *filename = NULL, *commit = NULL; char filename_buf[256]; int sha1_len = 8; - int compability = 0; + int compatibility = 0; int show_raw_time = 0; int options = 1; struct commit* start_commit; @@ -774,8 +774,8 @@ int main(int argc, const char **argv) sha1_len = 40; continue; } else if(!strcmp(argv[i], "-c") || - !strcmp(argv[i], "--compability")) { - compability = 1; + !strcmp(argv[i], "--compatibility")) { + compatibility = 1; continue; } else if(!strcmp(argv[i], "-t") || !strcmp(argv[i], "--time")) { @@ -784,7 +784,7 @@ int main(int argc, const char **argv) } else if(!strcmp(argv[i], "-S")) { if (i + 1 < argc && !read_ancestry(argv[i + 1], &sha1_p)) { - compability = 1; + compatibility = 1; i++; continue; } @@ -834,7 +834,7 @@ int main(int argc, const char **argv) } - init_revisions(&rev); + init_revisions(&rev, setup_git_directory()); rev.remove_empty_trees = 1; rev.topo_order = 1; rev.prune_fn = simplify_commit; @@ -884,7 +884,7 @@ int main(int argc, const char **argv) u = c->util; get_commit_info(c, &ci); fwrite(sha1_to_hex(c->object.sha1), sha1_len, 1, stdout); - if(compability) { + if(compatibility) { printf("\t(%10s\t%10s\t%d)", ci.author, format_time(ci.author_time, ci.author_tz, show_raw_time),