blame: improve diagnosis for "--reverse NEW"
authorJunio C Hamano <gitster@pobox.com>
Tue, 14 Jun 2016 17:46:06 +0000 (10:46 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 14 Jun 2016 19:12:15 +0000 (12:12 -0700)
"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>
Documentation/git-blame.txt
builtin/blame.c
index ba5417567c4df286a95a99cf1ae3e02ee466458f..16323eb80e3108794067c4dbfcbfe25e46938498 100644 (file)
@@ -10,7 +10,7 @@ SYNOPSIS
 [verse]
 'git blame' [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-e] [-p] [-w] [--incremental]
            [-L <range>] [-S <revs-file>] [-M] [-C] [-C] [-C] [--since=<date>]
 [verse]
 'git blame' [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-e] [-p] [-w] [--incremental]
            [-L <range>] [-S <revs-file>] [-M] [-C] [-C] [-C] [--since=<date>]
-           [--progress] [--abbrev=<n>] [<rev> | --contents <file> | --reverse <rev>]
+           [--progress] [--abbrev=<n>] [<rev> | --contents <file> | --reverse <rev>..<rev>]
            [--] <file>
 
 DESCRIPTION
            [--] <file>
 
 DESCRIPTION
index 21f42b0b62b81b637f1cc9589cd6c0306a93d05e..a027b8a6075dd2e300b307c4c20f41a4fbfc9566 100644 (file)
@@ -2466,14 +2466,14 @@ static char *prepare_initial(struct scoreboard *sb)
                if (obj->type != OBJ_COMMIT)
                        die("Non commit %s?", revs->pending.objects[i].name);
                if (sb->final)
                if (obj->type != OBJ_COMMIT)
                        die("Non commit %s?", revs->pending.objects[i].name);
                if (sb->final)
-                       die("More than one commit to dig down to %s and %s?",
+                       die("More than one commit to dig up from, %s and %s?",
                            revs->pending.objects[i].name,
                            final_commit_name);
                sb->final = (struct commit *) obj;
                final_commit_name = revs->pending.objects[i].name;
        }
        if (!final_commit_name)
                            revs->pending.objects[i].name,
                            final_commit_name);
                sb->final = (struct commit *) obj;
                final_commit_name = revs->pending.objects[i].name;
        }
        if (!final_commit_name)
-               die("No commit to dig down to?");
+               die("No commit to dig up from?");
        return xstrdup(final_commit_name);
 }
 
        return xstrdup(final_commit_name);
 }