Subject: Re: [PATCH v4 4/4] last-modified: verify revision argument is a commit-ish

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

Toon Claes <[email-masked]> writes:

> +		if (!repo_peel_to_type(lm->rev.repo, obj->path, 0, obj->item, OBJ_COMMIT)) {
> +			ret = error(_("revision argument '%s' is a %s, not a commit-ish"), obj->name, type_name(obj->item->type));
> +			goto out;
> +		}
> +

I do not use l10n version, but I am not sure how localization should
work with this message.

    _("revision argument '%s' is a %s, not a commit-ish")

There is no way type_name(obj->item->type) would be localized in
this code (after all, it is used in format_object_header() that is
the helper function to prepare the contents of the loose object
file).  Yet, it is tempting to translate "commit-ish" for those
preparing the .po files, which would lead to mixture of C-locale
'tree' and end-user-locale _("commit-ish").

I am wondering if we want to avoid this mixture by forcing the
C-locale for both, i.e.,

    error(_("revision argument '%s' is a %s, not a %s"),
	  obj->name, type_name(obj->item->type), 'commit-ish')

We can leave it as-is and polish the error messages later, of
course, but I am curious what the best practice is.

Thanks.