Subject: Re: [PATCH v4 1/4] last-modified: rewrite error message when more than one revision given

From: Junio C Hamano <[email-masked]>
Date: Fri, 23 Jan 2026 09:01:44 -0800

Toon Claes <[email-masked]> writes:

> 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
>
> While at it, ensure modify the test to ensure the correct error message
> is printed.

"ensure modify" -> "modify".

>  		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"));

I recall we earlier had discussions on "commit" vs "revision", but
was the conclusion that 'revision' is the appropriate term here?  I
somehow feel that it is sufficient to insist on "commit" (not
"commit-ish").  The way you are allowed to give that commit might be
more lenient and you may be able to pass a tag that points at a
commit, but that does not change the fact that the "last-modified"
command can only operate on one commit at a time, does it?

> +test_expect_success 'cannot run last-modified on two revision' '

"two revision" -> "two revisions".

> +	test_must_fail git last-modified HEAD HEAD~1 2>err &&
> +	test_grep "last-modified can only operate on one revision at a time" err
> +'
> +
>  test_expect_success 'last-modified complains about unknown arguments' '
>  	test_must_fail git last-modified --foo 2>err &&
> -	grep "unknown last-modified argument: --foo" err
> +	test_grep "unknown last-modified argument: --foo" err
>  '
>  
>  test_done