Re: [PATCH v4 1/4] last-modified: rewrite error message when more than one revision given
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 23, 2026, 17:01 UTC
- Message-ID
- <xmqqpl70i7pj.fsf@gitster.g>
- In-Reply-To
- <20260123-toon-last-modified-tree-v4-1-86bf97bad4e2@iotcl.com>
Toon Claes <toon@iotcl.com> writes:
Show 14 quoted lines
> 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".
Show 11 quoted lines
> + 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