[PATCH v2 1/8] pretty.c: better die message %(count) and %(total)
- From
Mirko Faina <mroik@delayed.space>
- Date
- Mar 19, 2026, 22:38 UTC
- Message-ID
- <a0d26c5999980f87b12022d12031d9f0dabbd864.1773959395.git.mroik@delayed.space>
- In-Reply-To
- <cover.1773959395.git.mroik@delayed.space>
Improve die messages for commands that do not support %(count) and %(total)
Signed-off-by: Mirko Faina <mroik@delayed.space> --- pretty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pretty.c b/pretty.c index 74673714c8..814803980b 100644 --- a/pretty.c +++ b/pretty.c @@ -1551,7 +1551,7 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */ if (starts_with(placeholder, "(count)")) { if (!c->pretty_ctx->rev) - die(_("this format specifier can't be used with this command")); + die(_("%s is not supported by this command"), "%(count)"); strbuf_addf(sb, "%0*d", decimal_width(c->pretty_ctx->rev->total), c->pretty_ctx->rev->nr); return 7; @@ -1559,7 +1559,7 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */ if (starts_with(placeholder, "(total)")) { if (!c->pretty_ctx->rev) - die(_("this format specifier can't be used with this command")); + die(_("%s is not supported by this command"), "%(total)"); strbuf_addf(sb, "%d", c->pretty_ctx->rev->total); return 7; }
-- 2.53.0.1018.g2bb0e51243