git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [Microproject v2] describe: do not translate --debug output

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 7, 2026, 04:56 UTC
Message-ID
<xmqqjymp9r4s.fsf@gitster.g>
In-Reply-To
<20261016185418.162998-1-antekborowski11@gmail.com>
Antoni Borowski <antekborowski11@gmail.com> writes:
Show 9 quoted lines
> @@ -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.

Previous: Junio C Hamano
Message 8 of 8 in “[Microproject] describe: pluralize tag/commit count messages”
  1. Antoni BorowskiOct 13, 2026
  2. Jeff KingOct 14, 2026
  3. Junio C HamanoOct 14, 2026
  4. [Microproject] describe: do not translate --debug outputAntoni Borowski, Oct 16, 2026
  5. Junio C HamanoOct 16, 2026
  6. [Microproject v2] describe: do not translate --debug outputAntoni Borowski, Oct 16, 2026
  7. Junio C HamanoNov 7, 2026
  8. Junio C HamanoNov 7, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.