Git development
 help / color / mirror / Atom feed
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 v2] describe: do not translate --debug output
Date: Fri, 06 Nov 2026 20:56:03 -0800	[thread overview]
Message-ID: <xmqqjymp9r4s.fsf@gitster.g> (raw)
In-Reply-To: <20261016185418.162998-1-antekborowski11@gmail.com> (Antoni Borowski's message of "Fri, 16 Oct 2026 20:54:18 +0200")

Antoni Borowski <antekborowski11@gmail.com> writes:

> @@ -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);
>  		}

This one has _(translation) still lurking here.  prio_names[] should
not be translated.

prio_names[] is defined as file-scope static.

    static const char *prio_names[] = {
            N_("head"), N_("lightweight"), N_("annotated"),
    };

In describe_commit(), the length of _(prio_names[]) is measured only
for debugging purposes (which is outside the pre-context of the
above hunk), and they are shown with the fprintf() we see above.

The values in prio_names[] should lose N_() around them, and all _()
around prio_names[] should bbe removed to make this conversion
complete.  Perhaps prio_names[] should be moved to that if (debug)
block, which is the only user of that array.  It may even make sense
to rename prio_names[] to make it clear that it is only used for
debugging output and nothing else.

So, earlier I said this looks ready for 'next', but no, it still
needs a bit more work.


      parent reply	other threads:[~2026-11-07  4:56 UTC|newest]

Thread overview: 8+ 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
2026-10-16 18:54         ` [Microproject v2] " Antoni Borowski
2026-11-07  2:23           ` Junio C Hamano
2026-11-07  4:56           ` Junio C Hamano [this message]

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=xmqqjymp9r4s.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox