blame: improve diagnosis for "--reverse NEW"
"git blame --reverse OLD..NEW -- PATH" tells us to start from the contents in PATH at OLD and observe how each line is changed while the history develops up to NEW, and report for each line the latest commit up to which the line survives in the original form. If you say "git blame --reverse NEW -- PATH" by mistake, we complain about the missing OLD, but we phrased it as "No commit to dig down to?" In this case, however, we are digging up from OLD, so say so. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Jun 14, 2016 at 10:46 UTC
d993ce1ed2f025708b0f78bed241466e35f1e8a0
2 files changed
+3
-3
Documentation/git-blame.txt
+1
-1
@@ -10,7 +10,7 @@ SYNOPSIS
10
[verse]
11
'git blame' [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-e] [-p] [-w] [--incremental]
12
[-L <range>] [-S <revs-file>] [-M] [-C] [-C] [-C] [--since=<date>]
13
- [--progress] [--abbrev=<n>] [<rev> | --contents <file> | --reverse <rev>]
13
+ [--progress] [--abbrev=<n>] [<rev> | --contents <file> | --reverse <rev>..<rev>]
14
[--] <file>
15
16
DESCRIPTION
builtin/blame.c
+2
-2
@@ -2466,14 +2466,14 @@ static char *prepare_initial(struct scoreboard *sb)
2466
if (obj->type != OBJ_COMMIT)
2467
die("Non commit %s?", revs->pending.objects[i].name);
2468
if (sb->final)
2469
- die("More than one commit to dig down to %s and %s?",
2469
+ die("More than one commit to dig up from, %s and %s?",
2470
revs->pending.objects[i].name,
2471
final_commit_name);
2472
sb->final = (struct commit *) obj;
2473
final_commit_name = revs->pending.objects[i].name;
2474
}
2475
if (!final_commit_name)
2476
- die("No commit to dig down to?");
2476
+ die("No commit to dig up from?");
2477
return xstrdup(final_commit_name);
2478
}
2479