]> git.ipfire.org Git - thirdparty/git.git/commitdiff
last-modified: rewrite error message when more than one revision given
authorToon Claes <toon@iotcl.com>
Fri, 16 Jan 2026 13:08:37 +0000 (14:08 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Jan 2026 17:30:26 +0000 (09:30 -0800)
When more than one revision is passed to the git-last-modified(1)
command, this error message was printed:

    error: last-modified can only operate on one tree at a time

Calling these a "tree" is technically not correct. git-last-modified(1)
expects revisions that peel to a commit.

Rephrase the error message to:

    error: last-modified can only operate on one revision at a time

Signed-off-by: Toon Claes <toon@iotcl.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/last-modified.c
t/t8020-last-modified.sh

index c80f0535f6a5033af6c7cd27dfc4dd5af2b5c1ab..7d95244e3f0b502018735faa6e21fff623d37982 100644 (file)
@@ -146,7 +146,7 @@ static int populate_paths_from_revs(struct last_modified *lm)
                        continue;
 
                if (num_interesting++)
-                       return error(_("last-modified can only operate on one tree at a time"));
+                       return error(_("last-modified can only operate on one revision at a time"));
 
                diff_tree_oid(lm->rev.repo->hash_algo->empty_tree,
                              &obj->item->oid, "", &diffopt);
index 50f4312f715f41ffeb091d6d7f9da7ec8b63e65c..1183ae667bd17d4121a7b007b31867717e140958 100755 (executable)
@@ -12,7 +12,7 @@ test_expect_success 'setup' '
        test_commit 3 a/b/file
 '
 
-test_expect_success 'cannot run last-modified on two trees' '
+test_expect_success 'cannot run last-modified on two revision' '
        test_must_fail git last-modified HEAD HEAD~1
 '