Subject: Re: [PATCH v3 3/4] last-modified: remove double error message

From: Junio C Hamano <[email-masked]>
Date: Fri, 16 Jan 2026 10:22:49 -0800

Toon Claes <[email-masked]> writes:

> When the user passes two revisions, they get the following output:
>
>     $ git last-modified HEAD HEAD~
>     error: last-modified can only operate on one revision at a time
>     error: unable to setup last-modified
>
> The error message about "unable to setup" is not very informative,
> remove it.
>
> Signed-off-by: Toon Claes <[email-masked]>
> ---
>  builtin/last-modified.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/builtin/last-modified.c b/builtin/last-modified.c
> index 06e3f79aec..0df85be318 100644
> --- a/builtin/last-modified.c
> +++ b/builtin/last-modified.c
> @@ -495,7 +495,7 @@ static int last_modified_init(struct last_modified *lm, struct repository *r,
>  	lm->rev.bloom_filter_settings = get_bloom_filter_settings(lm->rev.repo);
>  
>  	if (populate_paths_from_revs(lm) < 0)
> -		return error(_("unable to setup last-modified"));
> +		return -1;

It makes perfect sense to keep the more detailed error that
immediately leads to a more correct action and take out the more
generic "we failed" one.  Nice.