pretty.c: better die message %(count) and %(total)
Improve die messages for commands that do not support %(count) and %(total) Signed-off-by: Mirko Faina <mroik@delayed.space> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Mirko Faina committed
Mar 23, 2026 at 17:57 UTC
60cb27ed6575daafe86938fa5fcf3778fc4876f2
1 file changed
+2
-2
pretty.c
+2
-2
@@ -1551,7 +1551,7 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
1551
1552
if (starts_with(placeholder, "(count)")) {
1553
if (!c->pretty_ctx->rev)
1554
- die(_("this format specifier can't be used with this command"));
1554
+ die(_("%s is not supported by this command"), "%(count)");
1555
strbuf_addf(sb, "%0*d", decimal_width(c->pretty_ctx->rev->total),
1556
c->pretty_ctx->rev->nr);
1557
return 7;
@@ -1559,7 +1559,7 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
1559
1560
if (starts_with(placeholder, "(total)")) {
1561
if (!c->pretty_ctx->rev)
1562
- die(_("this format specifier can't be used with this command"));
1562
+ die(_("%s is not supported by this command"), "%(total)");
1563
strbuf_addf(sb, "%d", c->pretty_ctx->rev->total);
1564
return 7;
1565
}