From: Junio C Hamano <gitster@pobox.com>
To: Antoni Borowski <antekborowski11@gmail.com>
Cc: peff@peff.net, git@vger.kernel.org, jpoimboe@kernel.org
Subject: Re: [Microproject] describe: do not translate --debug output
Date: Fri, 16 Oct 2026 11:35:19 -0700 [thread overview]
Message-ID: <xmqqpkx9fq8o.fsf@gitster.g> (raw)
In-Reply-To: <20261016171835.90420-1-antekborowski11@gmail.com> (Antoni Borowski's message of "Fri, 16 Oct 2026 19:18:35 +0200")
Antoni Borowski <antekborowski11@gmail.com> writes:
> The --debug flag is aimed at developers debugging describe's search
> strategy, not at end users. Translating this output makes it harder
> to grep for known strings, compare logs across locales, or paste
> output into upstream bug reports written in English — all things
> developers routinely need to do.
>
> transport-helper.c already follows this convention: its "Debug: ..."
> messages are plain C strings with no gettext wrapper.
>
> Drop the _() and Q_() wrappers from describe_commit()'s debug-only
> fprintf() calls accordingly, and prefix them with "Debug: " to match
> transport-helper.c's style.
Nicely described. One nit in the proposed log message is that you
are not removing any Q_() at all ;-).
> Signed-off-by: Antoni Borowski <antekborowski11@gmail.com>
> ---
> builtin/describe.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
> diff --git a/builtin/describe.c b/builtin/describe.c
> index c0abc931a5..775f9f27f1 100644
> --- a/builtin/describe.c
> +++ b/builtin/describe.c
> @@ -351,7 +351,7 @@ static void describe_commit(struct commit *cmit, struct strbuf *dst)
> if (!max_candidates)
> die(_("no tag exactly matches '%s'"), oid_to_hex(&cmit->object.oid));
> if (debug)
> - fprintf(stderr, _("No exact match on refs or tags, searching to describe\n"));
> + fprintf(stderr, "Debug: No exact match on refs or tags, searching to describe\n");
>
> if (!have_util) {
> struct hashmap_iter iter;
> @@ -419,7 +419,7 @@ static void describe_commit(struct commit *cmit, struct strbuf *dst)
> }
> if ((c->object.flags & best_within) == best_within) {
> if (debug)
> - fprintf(stderr, _("finished search at %s\n"),
> + fprintf(stderr, "Debug: finished search at %s\n",
> oid_to_hex(&c->object.oid));
> break;
> }
> @@ -477,14 +477,14 @@ static void describe_commit(struct commit *cmit, struct strbuf *dst)
> }
> for (cur_match = 0; cur_match < match_cnt; cur_match++) {
> struct possible_tag *t = &all_matches[cur_match];
> - fprintf(stderr, " %-*s %8d %s\n",
> + fprintf(stderr, "Debug: %-*s %8d %s\n",
> label_width, _(prio_names[t->name->prio]),
> t->depth, t->name->path);
> }
> - fprintf(stderr, _("traversed %lu commits\n"), seen_commits);
> + fprintf(stderr, "Debug: traversed %lu commits\n", seen_commits);
> if (gave_up_on) {
> fprintf(stderr,
> - _("found %i tags; gave up search at %s\n"),
> + "Debug: found %i tags; gave up search at %s\n",
> max_candidates,
> oid_to_hex(&gave_up_on->object.oid));
> }
> @@ -565,7 +565,7 @@ static void describe(const char *arg, int last_one)
> struct strbuf sb = STRBUF_INIT;
>
> if (debug)
> - fprintf(stderr, _("describe %s\n"), arg);
> + fprintf(stderr, "Debug: describe %s\n", arg);
>
> if (repo_get_oid(the_repository, arg, &oid))
> die(_("Not a valid object name %s"), arg);
next prev parent reply other threads:[~2026-10-16 18:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 20:43 [Microproject] describe: pluralize tag/commit count messages Antoni Borowski
2026-10-14 9:29 ` Jeff King
2026-10-14 17:36 ` Junio C Hamano
2026-10-16 17:18 ` [Microproject] describe: do not translate --debug output Antoni Borowski
2026-10-16 18:35 ` Junio C Hamano [this message]
2026-10-16 18:54 ` [Microproject v2] " Antoni Borowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqpkx9fq8o.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=antekborowski11@gmail.com \
--cc=git@vger.kernel.org \
--cc=jpoimboe@kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.