{"thread":{"id":"66564","subject":"[PATCH] difftool: translate \"combined diff formats\" error message","startedAt":"2026-10-17T06:40:39Z","lastAt":"2026-10-22T19:49:07Z","messageCount":2,"participants":["Ammaar Bakshi via GitGitGadget","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"555298","messageId":"pull.2447.git.git.1792219239440.gitgitgadget@gmail.com","threadId":"66564","inReplyTo":null,"subject":"[PATCH] difftool: translate \"combined diff formats\" error message","fromName":"Ammaar Bakshi via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-10-17T06:40:39Z","receivedAt":"2026-10-17T06:40:39Z","isPatch":true,"sender":{"key":"name:Ammaar Bakshi","avatar":null},"body":"From: AMMAAR-IC <the.ammaar.ic@gmail.com>\n\nThe error shown when \"git difftool --dir-diff\" is given a combined\ndiff format ('-c' or '--cc') is wrapped in N_(), which only marks the\nstring for extraction by xgettext and does nothing at runtime. As the\nstring is passed straight to die(), users always see it in English,\neven though it already has translations in the po files.\n\nUse _() instead, and adjust the indentation of the continuation lines\nto match.\n\nSigned-off-by: AMMAAR-IC <the.ammaar.ic@gmail.com>\n---\n    difftool: translate \"combined diff formats\" error message\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2447%2FAmmaarBakshi%2Fdifftool-i18n-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2447/AmmaarBakshi/difftool-i18n-v1\nPull-Request: https://github.com/git/git/pull/2447\n\n builtin/difftool.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/difftool.c b/builtin/difftool.c\nindex bc7b2ea443..13b3d3ce47 100644\n--- a/builtin/difftool.c\n+++ b/builtin/difftool.c\n@@ -450,9 +450,9 @@ static int run_dir_diff(struct repository *repo,\n \t\tconst char *src_path, *dst_path;\n \n \t\tif (starts_with(info.buf, \"::\"))\n-\t\t\tdie(N_(\"combined diff formats ('-c' and '--cc') are \"\n-\t\t\t       \"not supported in\\n\"\n-\t\t\t       \"directory diff mode ('-d' and '--dir-diff').\"));\n+\t\t\tdie(_(\"combined diff formats ('-c' and '--cc') are \"\n+\t\t\t      \"not supported in\\n\"\n+\t\t\t      \"directory diff mode ('-d' and '--dir-diff').\"));\n \n \t\tif (parse_index_info(repo, info.buf, &lmode, &rmode, &loid, &roid, &status))\n \t\t\tbreak;\n\nbase-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd\n-- \ngitgitgadget\n\n"},{"id":"555902","messageId":"xmqqy0bpecss.fsf@gitster.g","threadId":"66564","inReplyTo":"pull.2447.git.git.1792219239440.gitgitgadget@gmail.com","subject":"Re: [PATCH] difftool: translate \"combined diff formats\" error message","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-22T19:49:07Z","receivedAt":"2026-10-22T19:49:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Ammaar Bakshi via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: AMMAAR-IC <the.ammaar.ic@gmail.com>\n>\n> The error shown when \"git difftool --dir-diff\" is given a combined\n> diff format ('-c' or '--cc') is wrapped in N_(), which only marks the\n> string for extraction by xgettext and does nothing at runtime. As the\n> string is passed straight to die(), users always see it in English,\n> even though it already has translations in the po files.\n>\n> Use _() instead, and adjust the indentation of the continuation lines\n> to match.\n>\n> Signed-off-by: AMMAAR-IC <the.ammaar.ic@gmail.com>\n\nThe name that appears on the \"From:\" header in your email, \"Ammaar\nBakshi <the.ammaar.ic@gmail.com>\", somehow looks more real than the\nhandle-looking \"AMMAAR-IC\".\n\nPlease consult Documentation/SubmittingPatches and specifically look\nfor [[dco]] and [[real-name]].\n\nThe patch text may look like an improvement but without a proper\nauthorship and sign-off, we cannot use the change in our project.\n\nThanks.\n\n> ---\n>     difftool: translate \"combined diff formats\" error message\n>\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2447%2FAmmaarBakshi%2Fdifftool-i18n-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2447/AmmaarBakshi/difftool-i18n-v1\n> Pull-Request: https://github.com/git/git/pull/2447\n>\n>  builtin/difftool.c | 6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n>\n> diff --git a/builtin/difftool.c b/builtin/difftool.c\n> index bc7b2ea443..13b3d3ce47 100644\n> --- a/builtin/difftool.c\n> +++ b/builtin/difftool.c\n> @@ -450,9 +450,9 @@ static int run_dir_diff(struct repository *repo,\n>  \t\tconst char *src_path, *dst_path;\n>  \n>  \t\tif (starts_with(info.buf, \"::\"))\n> -\t\t\tdie(N_(\"combined diff formats ('-c' and '--cc') are \"\n> -\t\t\t       \"not supported in\\n\"\n> -\t\t\t       \"directory diff mode ('-d' and '--dir-diff').\"));\n> +\t\t\tdie(_(\"combined diff formats ('-c' and '--cc') are \"\n> +\t\t\t      \"not supported in\\n\"\n> +\t\t\t      \"directory diff mode ('-d' and '--dir-diff').\"));\n>  \n>  \t\tif (parse_index_info(repo, info.buf, &lmode, &rmode, &loid, &roid, &status))\n>  \t\t\tbreak;\n>\n> base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd\n\n"}]}