Skip to content

Commit d993ce1

Browse files
committed
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 <[email protected]>
1 parent 0b65a8d commit d993ce1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Documentation/git-blame.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SYNOPSIS
1010
[verse]
1111
'git blame' [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-e] [-p] [-w] [--incremental]
1212
[-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>]
1414
[--] <file>
1515

1616
DESCRIPTION

builtin/blame.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2466,14 +2466,14 @@ static char *prepare_initial(struct scoreboard *sb)
24662466
if (obj->type != OBJ_COMMIT)
24672467
die("Non commit %s?", revs->pending.objects[i].name);
24682468
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?",
24702470
revs->pending.objects[i].name,
24712471
final_commit_name);
24722472
sb->final = (struct commit *) obj;
24732473
final_commit_name = revs->pending.objects[i].name;
24742474
}
24752475
if (!final_commit_name)
2476-
die("No commit to dig down to?");
2476+
die("No commit to dig up from?");
24772477
return xstrdup(final_commit_name);
24782478
}
24792479

0 commit comments

Comments
 (0)