From patchwork Sun Oct 28 06:51:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10658477 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 64446174F for ; Sun, 28 Oct 2018 06:52:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5614A2980B for ; Sun, 28 Oct 2018 06:52:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 402292A06D; Sun, 28 Oct 2018 06:52:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A3272A06D for ; Sun, 28 Oct 2018 06:52:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727532AbeJ1Pfs (ORCPT ); Sun, 28 Oct 2018 11:35:48 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:40485 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726734AbeJ1Pfs (ORCPT ); Sun, 28 Oct 2018 11:35:48 -0400 Received: by mail-lj1-f193.google.com with SMTP id t22-v6so4788615lji.7 for ; Sat, 27 Oct 2018 23:52:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0oAnrQf77bV8x6zqJItp0DV6sU7wpFBQ9f7w61XuEZ0=; b=h+8FXu/FC8i+bJNwe6q3uWRxmSOQ5DOqVz0fUvel5ha+fHiUU1Ag7nlJ7d5WMseTKN jcN23WVJV3Z+cAECmKVg5Xib6a5ZyTwk1KgT/Qgmr/oLXyxDDlQ9ntIaUhwkXFqn4kMC nLFoJaybkhc40GhbBcNpusgiH/Ya3uunwxAYI62hK2jP8dgwmuGXo5RaHT7e1fpreXIm FygaipfoDnCa3/qzNrYcQ6hXdZ5AOJS1pzRDDccDvjddU6m2RDtIK8pV2ME4Re92EirG Ww3n1m4fzwLgPhZNLZpQ8XLWjIT5/532fg5oX0C2T3pDs6apsbsioWZ1ugrCEi3FyUZp OJmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0oAnrQf77bV8x6zqJItp0DV6sU7wpFBQ9f7w61XuEZ0=; b=YO1uP9r/EdrJ2759CtxyEB74WUKKHGFBwgatXFLGtK8HEF+He68qxdfjV8683ssF1B fZBJQzNAll74PC2pl0oT5HiMYbwp0xEx4Ne55RwzJJxiKVoIqYNu+fSAL2SQr0swvOlH nthOuH/JuuE/ZmPb5VilVjisrGA/IgY14jBN6gMslsw9Nqc+HPPQYy3AQ/7pmf5LTqp8 a/m/x5vYCX+jes3E2+cv+tgGgzFk7PnbTg7YLlBf7s0/Ql1Xz2bjmRjRUfiMIpz1Duv3 LVrmmQww1B0te8nKCsIscFXfzl8KYJ5cBRtlHaxDSQCb1VMqpo6mBLVbWNcWBsKHrEWi gNsw== X-Gm-Message-State: AGRZ1gJwAWy0uH5LJPu8mJgtYJI5TWmZ33ohTIMDU7pKY1PBgxYNN5Ei g3+aUd2dZm+PfAhbZrkhRMF11sXT X-Google-Smtp-Source: AJdET5dZvL+keCTSXAKaFBrK2z672NhEA3F9LgBYd6lUOuar4qf2xqh9EsMBuYWB5z5NPpKSLoI33A== X-Received: by 2002:a2e:8eca:: with SMTP id e10-v6mr3295178ljl.109.1540709523443; Sat, 27 Oct 2018 23:52:03 -0700 (PDT) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id v23-v6sm148847ljd.70.2018.10.27.23.52.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Oct 2018 23:52:02 -0700 (PDT) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: git@vger.kernel.org Cc: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= Subject: [PATCH 01/12] git.c: mark more strings for translation Date: Sun, 28 Oct 2018 07:51:46 +0100 Message-Id: <20181028065157.26727-2-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.647.g708186aaf9 In-Reply-To: <20181028065157.26727-1-pclouds@gmail.com> References: <20181028065157.26727-1-pclouds@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Nguyễn Thái Ngọc Duy --- git.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/git.c b/git.c index adac132956..1ad565c5c8 100644 --- a/git.c +++ b/git.c @@ -338,27 +338,27 @@ static int handle_alias(int *argcp, const char ***argv) if (ret >= 0) /* normal exit */ exit(ret); - die_errno("while expanding alias '%s': '%s'", - alias_command, alias_string + 1); + die_errno(_("while expanding alias '%s': '%s'"), + alias_command, alias_string + 1); } count = split_cmdline(alias_string, &new_argv); if (count < 0) - die("Bad alias.%s string: %s", alias_command, + die(_("bad alias.%s string: %s"), alias_command, split_cmdline_strerror(count)); option_count = handle_options(&new_argv, &count, &envchanged); if (envchanged) - die("alias '%s' changes environment variables.\n" - "You can use '!git' in the alias to do this", - alias_command); + die(_("alias '%s' changes environment variables.\n" + "You can use '!git' in the alias to do this"), + alias_command); memmove(new_argv - option_count, new_argv, count * sizeof(char *)); new_argv -= option_count; if (count < 1) - die("empty alias for %s", alias_command); + die(_("empty alias for %s"), alias_command); if (!strcmp(alias_command, new_argv[0])) - die("recursive alias: %s", alias_command); + die(_("recursive alias: %s"), alias_command); trace_argv_printf(new_argv, "trace: alias expansion: %s =>", @@ -409,7 +409,7 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv) if (!help && get_super_prefix()) { if (!(p->option & SUPPORT_SUPER_PREFIX)) - die("%s doesn't support --super-prefix", p->cmd); + BUG("%s doesn't support --super-prefix", p->cmd); } if (!help && p->option & NEED_WORK_TREE) @@ -433,11 +433,11 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv) /* Check for ENOSPC and EIO errors.. */ if (fflush(stdout)) - die_errno("write failure on standard output"); + die_errno(_("write failure on standard output")); if (ferror(stdout)) - die("unknown write failure on standard output"); + die(_("unknown write failure on standard output")); if (fclose(stdout)) - die_errno("close failed on standard output"); + die_errno(_("close failed on standard output")); return 0; } @@ -648,7 +648,7 @@ static void execv_dashed_external(const char **argv) int status; if (get_super_prefix()) - die("%s doesn't support --super-prefix", argv[0]); + BUG("%s doesn't support --super-prefix", argv[0]); if (use_pager == -1 && !is_builtin(argv[0])) use_pager = check_pager_config(argv[0]); @@ -760,7 +760,7 @@ int cmd_main(int argc, const char **argv) if (skip_prefix(cmd, "git-", &cmd)) { argv[0] = cmd; handle_builtin(argc, argv); - die("cannot handle %s as a builtin", cmd); + die(_("cannot handle %s as a builtin"), cmd); } /* Look for flags.. */ @@ -773,7 +773,7 @@ int cmd_main(int argc, const char **argv) } else { /* The user didn't specify a command; give them help */ commit_pager_choice(); - printf("usage: %s\n\n", git_usage_string); + printf(_("usage: %s\n\n"), git_usage_string); list_common_cmds_help(); printf("\n%s\n", _(git_more_info_string)); exit(1); From patchwork Sun Oct 28 06:51:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10658479 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 81307109C for ; Sun, 28 Oct 2018 06:52:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F74E2A06D for ; Sun, 28 Oct 2018 06:52:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D2BE2A0B6; Sun, 28 Oct 2018 06:52:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4AB072A072 for ; Sun, 28 Oct 2018 06:52:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727723AbeJ1Pft (ORCPT ); Sun, 28 Oct 2018 11:35:49 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:45870 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725791AbeJ1Pft (ORCPT ); Sun, 28 Oct 2018 11:35:49 -0400 Received: by mail-lf1-f65.google.com with SMTP id c24-v6so3715765lfi.12 for ; Sat, 27 Oct 2018 23:52:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YICb1dBgDa4LM229qG6/527E5MtMS+f7K7YwXjgwCL0=; b=ueUfmkiHugMlTTFJy/w81maijWTdK5YPwYRhdI2eon+6jdSgoZNIIvaqaJEc/5ewLf E6ZGe/7D8FhjUDMae7ytPTHBNW6AIhz7dr2+Vuu5QaDVCJLBl93p+u/kHdGxC5J9T5fF iDam92nfzFGyx8Y+j5Ha4kr7bFqpNNuaLfrUZ7gd8Gi5fZcrLwM8KSrkt42Fj2vKqDQT sl45mWgRfgTWxEt0L7h5X/OkzQ+cD1vChthcbIFxGQOfnRhHeMv4g/Dcu2t+XEkoIuyy nj5lYhq15dhvQI1OqWvvORMHvgAyiLcYX8tp6YCq1lh11enT1CgkXwQbQhTUyDVNprSy g8pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YICb1dBgDa4LM229qG6/527E5MtMS+f7K7YwXjgwCL0=; b=nBlJ/v0zr1bUmva29N8YBh+GSu5f7gDMsWEdC8jjO6OwZwh9uxk5HtlwrpnlatCO6i ccUEZY+U1t7nvmIzXIGWelWMXegmILgvFBvL7Ucvg7Uhazorh3HgcDRagVoI7h2F8Jhx NeXFXNt1tWOrsVFGkxmCHFhP/SL5uTbf2ZUO22Vz63rNgijgyV0PAWGJRVVzDrulq8Q5 1C6EHBRuKRXmQaqL95VSSfxEiP66vRQ1xaDPrrJCG0fBndME6+gyZ6jfpJondRqbEKlR 30LmbVue7vjM7IXjD+RP7KHt6QiKWEFD/k51s0a39wzJAK2refUqnc1H17QE5pxFciOe evXw== X-Gm-Message-State: AGRZ1gIFqQYoMTepQHTuRBE3rb/3iGfIUOEruyapR4jDR9GdY5ewYqla mBw7VKUsjP58mQK3RcRvT40qRB8Q X-Google-Smtp-Source: AJdET5ewdfPs+4nA78lSI4aj0Fe6JWOUNoT1Xi8PmMvP9/B6DH0pjS2V5EXM6wecAHsQWYuA0FZahw== X-Received: by 2002:a19:be16:: with SMTP id o22mr5566860lff.22.1540709524498; Sat, 27 Oct 2018 23:52:04 -0700 (PDT) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id v23-v6sm148847ljd.70.2018.10.27.23.52.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Oct 2018 23:52:03 -0700 (PDT) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: git@vger.kernel.org Cc: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= Subject: [PATCH 02/12] alias.c: mark split_cmdline_strerror() strings for translation Date: Sun, 28 Oct 2018 07:51:47 +0100 Message-Id: <20181028065157.26727-3-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.647.g708186aaf9 In-Reply-To: <20181028065157.26727-1-pclouds@gmail.com> References: <20181028065157.26727-1-pclouds@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This function can be part of translated messages. To make sure we don't have a sentence with mixed languages, mark the strings for translation, but only use translated strings in places we know we will output translated strings. Signed-off-by: Nguyễn Thái Ngọc Duy --- alias.c | 4 ++-- builtin/merge.c | 2 +- git.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/alias.c b/alias.c index a7e4e57130..c471538020 100644 --- a/alias.c +++ b/alias.c @@ -47,8 +47,8 @@ void list_aliases(struct string_list *list) #define SPLIT_CMDLINE_BAD_ENDING 1 #define SPLIT_CMDLINE_UNCLOSED_QUOTE 2 static const char *split_cmdline_errors[] = { - "cmdline ends with \\", - "unclosed quote" + N_("cmdline ends with \\"), + N_("unclosed quote") }; int split_cmdline(char *cmdline, const char ***argv) diff --git a/builtin/merge.c b/builtin/merge.c index 4aa6071598..92ba7e1c6d 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -577,7 +577,7 @@ static void parse_branch_merge_options(char *bmo) argc = split_cmdline(bmo, &argv); if (argc < 0) die(_("Bad branch.%s.mergeoptions string: %s"), branch, - split_cmdline_strerror(argc)); + _(split_cmdline_strerror(argc))); REALLOC_ARRAY(argv, argc + 2); MOVE_ARRAY(argv + 1, argv, argc + 1); argc++; diff --git a/git.c b/git.c index 1ad565c5c8..09d6169f6c 100644 --- a/git.c +++ b/git.c @@ -344,7 +344,7 @@ static int handle_alias(int *argcp, const char ***argv) count = split_cmdline(alias_string, &new_argv); if (count < 0) die(_("bad alias.%s string: %s"), alias_command, - split_cmdline_strerror(count)); + _(split_cmdline_strerror(count))); option_count = handle_options(&new_argv, &count, &envchanged); if (envchanged) die(_("alias '%s' changes environment variables.\n" From patchwork Sun Oct 28 06:51:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10658495 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 095163CF1 for ; Sun, 28 Oct 2018 06:52:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC1F02980B for ; Sun, 28 Oct 2018 06:52:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DFE722A07D; Sun, 28 Oct 2018 06:52:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B40D2A075 for ; Sun, 28 Oct 2018 06:52:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727745AbeJ1Pfu (ORCPT ); Sun, 28 Oct 2018 11:35:50 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:37013 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726734AbeJ1Pft (ORCPT ); Sun, 28 Oct 2018 11:35:49 -0400 Received: by mail-lj1-f196.google.com with SMTP id c4-v6so4795436lja.4 for ; Sat, 27 Oct 2018 23:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6URvdzBWtkgiHAB1x19g94d7Z2NG2Xhe7Gk5siCXaes=; b=o/4ZHkw/nCwF1aW1+08m5Jse35LBAQF6sAy1dVXA7Y7TlSqSYRP8Pk4Ko5IEnkXGQX uN3rJo/dRIwg6RTsftLHNVxewE+fsEUA1+g/kuS6jA6OsYYah4f8ZeBUqnAi+KV511od 63BkUAE7lvO+Pmn+oOPDwOnibL1tfqoMHqPQ2dkF9bgNMTdbK/6XOu2KAeh9eFR71Adu O6PGPfdEUjE91d1oKuAAMaF5tglSWZwAWqdNAVE0PrxBu4AmjrJH6f6TgksBxRmUgv/R shJBFXG9oDrbecaEl5eMnS6e3iNMJSTOD6hGJOWOu9cTXNMOe25+Xw5f3M9b8nVQiUaa rLdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6URvdzBWtkgiHAB1x19g94d7Z2NG2Xhe7Gk5siCXaes=; b=D4aewOQhMo/XKCMT+K0TIJHi3JcoDdgYQvI/UGqPfkefRl+HRYOeinwISAqtV4KuBH HJZwYcdKQ67vX6EFTiFyowoHabcIx8/pTbIhr/6vRj5neWqGaCFEM04FRo1Id3j1Haqr ed7/gcsw32TLXD2gMCJHbcWspYMXgkOsXhn06IyzX+OvpA6/a8VuAiWecrUV2cS7bqW8 OZZRqPE52LnPCfIjZhJZKTowotO0OpQ0lJdApJLTdSA25l163957tdSF8fa5kpxbwtul pqbR5KAxcTFmfTgiW/4HLX+HvvTxncJuhN88xqTykituXbpbAW2rz/DSG1VUOx3mv0E3 nbHg== X-Gm-Message-State: AGRZ1gL+sK7liM6n9QXmEuxmGnMBzAC03IfF1RXktG9Uz639ki0V4Zrq fP50abp+YW02AeNqvtJQcVEaRpHu X-Google-Smtp-Source: AJdET5cVAIfA9kjoAqvn0BPE1If/ScplxzvrGDFVdn9dW0emx3T5SMskYusvm1SuTcufwoo8lTPilg== X-Received: by 2002:a2e:6d0a:: with SMTP id i10-v6mr6847629ljc.14.1540709525462; Sat, 27 Oct 2018 23:52:05 -0700 (PDT) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id v23-v6sm148847ljd.70.2018.10.27.23.52.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Oct 2018 23:52:04 -0700 (PDT) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: git@vger.kernel.org Cc: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= Subject: [PATCH 03/12] archive.c: mark more strings for translation Date: Sun, 28 Oct 2018 07:51:48 +0100 Message-Id: <20181028065157.26727-4-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.647.g708186aaf9 In-Reply-To: <20181028065157.26727-1-pclouds@gmail.com> References: <20181028065157.26727-1-pclouds@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Nguyễn Thái Ngọc Duy --- archive.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/archive.c b/archive.c index 9d16b7fadf..757519a9d6 100644 --- a/archive.c +++ b/archive.c @@ -385,12 +385,12 @@ static void parse_treeish_arg(const char **argv, int refnamelen = colon - name; if (!dwim_ref(name, refnamelen, &oid, &ref)) - die("no such ref: %.*s", refnamelen, name); + die(_("no such ref: %.*s"), refnamelen, name); free(ref); } if (get_oid(name, &oid)) - die("Not a valid object name"); + die(_("'%s' is not a valid object name"), name); commit = lookup_commit_reference_gently(ar_args->repo, &oid, 1); if (commit) { @@ -403,7 +403,7 @@ static void parse_treeish_arg(const char **argv, tree = parse_tree_indirect(&oid); if (tree == NULL) - die("not a tree object"); + die(_("%s is not a tree object"), oid_to_hex(&oid)); if (prefix) { struct object_id tree_oid; @@ -413,7 +413,7 @@ static void parse_treeish_arg(const char **argv, err = get_tree_entry(&tree->object.oid, prefix, &tree_oid, &mode); if (err || !S_ISDIR(mode)) - die("current working directory is untracked"); + die(_("current working directory is untracked")); tree = parse_tree_indirect(&tree_oid); } From patchwork Sun Oct 28 06:51:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10658493 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E40E4109C for ; Sun, 28 Oct 2018 06:52:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D29AA2980B for ; Sun, 28 Oct 2018 06:52:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C70C02A06D; Sun, 28 Oct 2018 06:52:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C1422A079 for ; Sun, 28 Oct 2018 06:52:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727764AbeJ1Pfv (ORCPT ); Sun, 28 Oct 2018 11:35:51 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:45107 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725791AbeJ1Pfv (ORCPT ); Sun, 28 Oct 2018 11:35:51 -0400 Received: by mail-lj1-f195.google.com with SMTP id j4-v6so4780387ljc.12 for ; Sat, 27 Oct 2018 23:52:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=djLcnc/ogJNL4Z13pc77uU3n+GglYQ7EVoZPsqvs5Q4=; b=DZDgyfAd6h+PwSiBo4JpcLSvE4VjM9IUn1qOt715nPrgPMGa0UHozW453N5er6nxML TBKAEAdRHqqoozM3k45Xd9FoTNZa5yAgF2NVre8vGJ1fnYvYXrFHypUs7WLjnNZVug4L u6ztxU0x7xONNDwHlrJgvu6ygTOIQUTfBEhUsa64ePkbnADzibcmhEChSJEGca9SBO6H w0dX8ju/4cW0vdOu8JJxdwlg1HNWU79VCi5XhEmKwfdBI7Ps5jGNdhrqefQq4OlVkJQ3 H9aoyG4BZq4O/Q3FpQj2U2+2vEZAYoyXMAEu9oRzPJvXjC+VwkHKqJCHRe+B05vEeHLx m92g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=djLcnc/ogJNL4Z13pc77uU3n+GglYQ7EVoZPsqvs5Q4=; b=WKRDupROVEfESxzRvRL1jYwE6eirI3virAlpstwpDudRhEDDBrs4PeTkwGmGGlTETo +BBjjJgeMQ0qvW2BEVJ/VHabYKXB3z+iRB/1b3L2ssjPhU53x2S14pRXk7CxWUDWHwN8 O53CSbMBaSaZF+crSIDBXVQsglJhP73DTTzLqFZRo5ZTIXwY4mrVOTnZknatTK6eDtW8 tbvgDlWd8NQjWgBd/GwK5H6mEuH2lzuwmPOydcSEYYohqJrtvtCV+jdfoK/3sAxG+H16 JzAVq+1JZTtu+cAryoJMPMNTKX9Fhq8conuLx2s9fkYPZNtdY2f1tSRR3qfAtZAgudPL vUHA== X-Gm-Message-State: AGRZ1gIEnAR1cLYER7HuntQQSGpcpUfkqBQ9eMExPmBYse8LbqT+D9BB TDI+tsruLo1dOCzZJk2FPwwKKpC+ X-Google-Smtp-Source: AJdET5cp2X1dZ5ltLvCs/hP4AOhqYmhKMSp9OehBX7gTRpiH97ikT+Sf8trziPipQjPw4GslNXrbwQ== X-Received: by 2002:a2e:21d2:: with SMTP id h79-v6mr6265078lji.46.1540709526589; Sat, 27 Oct 2018 23:52:06 -0700 (PDT) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id v23-v6sm148847ljd.70.2018.10.27.23.52.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Oct 2018 23:52:05 -0700 (PDT) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: git@vger.kernel.org Cc: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= Subject: [PATCH 04/12] attr.c: mark more string for translation Date: Sun, 28 Oct 2018 07:51:49 +0100 Message-Id: <20181028065157.26727-5-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.647.g708186aaf9 In-Reply-To: <20181028065157.26727-1-pclouds@gmail.com> References: <20181028065157.26727-1-pclouds@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Nguyễn Thái Ngọc Duy --- attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attr.c b/attr.c index 60d284796d..4ebc169abe 100644 --- a/attr.c +++ b/attr.c @@ -372,7 +372,7 @@ static struct match_attr *parse_attr_line(const char *line, const char *src, if (strlen(ATTRIBUTE_MACRO_PREFIX) < namelen && starts_with(name, ATTRIBUTE_MACRO_PREFIX)) { if (!macro_ok) { - fprintf(stderr, "%s not allowed: %s:%d\n", + fprintf(stderr, _("%s not allowed: %s:%d\n"), name, src, lineno); goto fail_return; } From patchwork Sun Oct 28 06:51:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10658487 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F31D146E4 for ; Sun, 28 Oct 2018 06:52:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0C532980B for ; Sun, 28 Oct 2018 06:52:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5B9A2A06D; Sun, 28 Oct 2018 06:52:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACD362A07D for ; Sun, 28 Oct 2018 06:52:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727784AbeJ1Pfx (ORCPT ); Sun, 28 Oct 2018 11:35:53 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:36184 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726734AbeJ1Pfw (ORCPT ); Sun, 28 Oct 2018 11:35:52 -0400 Received: by mail-lj1-f193.google.com with SMTP id s15-v6so4813148lji.3 for ; Sat, 27 Oct 2018 23:52:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kbUO4GSr0Ax024oQ68siVejksBL7aZgUcPnT67uEaKo=; b=ULPVf6uyV5bBc845UqKtHI4sH7xqjVQrgVeNvBauFH3lGZbS6AQeLfeas7/AL/HiaT PVzGAUhcG0PrBQcZhEBZPzgA/YMjzgksohiY13Sd5Z2VLvMVvcE6HdXWB3TQ4W31yZM4 J90Hb9w4ClZp8uLfJRRXg6npgz8tQMl5443CGnIpRtwmriJ0QZ09JGni9RYJBgvQCkDs xmpuZ+SAOIrmBljwdlh1JhJyJKkO1xe5N6Jyedrh9dSCGGIEcsJ371ArwodECdzM19jb FctBxnkbKqzE7l5HolLVtsYKiGxH51p+BoTVgPu8C+3LTxhRCYZVF+fZJvDZvZK77pSQ PEYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kbUO4GSr0Ax024oQ68siVejksBL7aZgUcPnT67uEaKo=; b=CDZ19p/i9su13g4FIZ7Hens1ofHQ6kbv5BoO704Pg2rnLX87npB4PuIQWWOjdLaiRS 5h3IYwIGOlWawzq0VBIIJFQBGXWfm7jDnW94FPxickac4auMMYoPhUGwGxF/1p0yLzLI bDKK1wVqBACZqo28zP2FvWRvtNGggqLGZCcuDyHA5KlyN+xb6LhlvOthsmwaDdvQx8jd 84uuVxKY2LQHTuzZ+HDDILdgME/+zWFHWP6+rsX3lsPUIpIdwRE8OBPc2LS9Hg9CfYqZ YtjKTK+vE09uyZWFBYdSWpTAua8er73YLkBRiJ3gwxrO+oNKDDTQOTSL4MyFrG16Gh7N dClA== X-Gm-Message-State: AGRZ1gJ73+wft12t214Y1vmedvy9CgBLG5Em4SQoF9fXZVWSMlpxzHBx A4isEpnzmoeRX21GASDUNn/MSYFW X-Google-Smtp-Source: AJdET5dSKrGYDD98GKebd+PwHa+Zwr6ypaVQIg8U1JeMTs5jxyJ9JmGmADq7PZRtkAFEVxB09eJvSA== X-Received: by 2002:a2e:9bd7:: with SMTP id w23-v6mr2393078ljj.93.1540709527760; Sat, 27 Oct 2018 23:52:07 -0700 (PDT) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id v23-v6sm148847ljd.70.2018.10.27.23.52.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Oct 2018 23:52:06 -0700 (PDT) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: git@vger.kernel.org Cc: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= Subject: [PATCH 05/12] read-cache.c: mark more strings for translation Date: Sun, 28 Oct 2018 07:51:50 +0100 Message-Id: <20181028065157.26727-6-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.647.g708186aaf9 In-Reply-To: <20181028065157.26727-1-pclouds@gmail.com> References: <20181028065157.26727-1-pclouds@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There are a couple other improvements on these strings as well: - add missing colon (as separator) - quote paths - provide more information on error messages - keep first word in lowercase - some die() become BUG() Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c | 63 +++++++++++++++++++++++++------------------------ t/t1450-fsck.sh | 2 +- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/read-cache.c b/read-cache.c index d57958233e..5083cd8333 100644 --- a/read-cache.c +++ b/read-cache.c @@ -316,7 +316,7 @@ static int ce_match_stat_basic(const struct cache_entry *ce, struct stat *st) changed |= DATA_CHANGED; return changed; default: - die("internal error: ce_mode is %o", ce->ce_mode); + BUG("unsupported ce_mode %o", ce->ce_mode); } changed |= match_stat_data(&ce->ce_stat_data, st); @@ -672,7 +672,8 @@ static struct cache_entry *create_alias_ce(struct index_state *istate, struct cache_entry *new_entry; if (alias->ce_flags & CE_ADDED) - die("Will not add file alias '%s' ('%s' already exists in index)", ce->name, alias->name); + die(_("will not add file alias '%s' ('%s' already exists in index)"), + ce->name, alias->name); /* Ok, create the new entry using the name of the existing alias */ len = ce_namelen(alias); @@ -687,7 +688,7 @@ void set_object_name_for_intent_to_add_entry(struct cache_entry *ce) { struct object_id oid; if (write_object_file("", 0, blob_type, &oid)) - die("cannot create an empty blob in the object database"); + die(_("cannot create an empty blob in the object database")); oidcpy(&ce->oid, &oid); } @@ -708,7 +709,7 @@ int add_to_index(struct index_state *istate, const char *path, struct stat *st, newflags |= HASH_RENORMALIZE; if (!S_ISREG(st_mode) && !S_ISLNK(st_mode) && !S_ISDIR(st_mode)) - return error("%s: can only add regular files, symbolic links or git-directories", path); + return error(_("%s: can only add regular files, symbolic links or git-directories"), path); namelen = strlen(path); if (S_ISDIR(st_mode)) { @@ -763,7 +764,7 @@ int add_to_index(struct index_state *istate, const char *path, struct stat *st, if (!intent_only) { if (index_path(istate, &ce->oid, path, st, newflags)) { discard_cache_entry(ce); - return error("unable to index file %s", path); + return error(_("unable to index file '%s'"), path); } } else set_object_name_for_intent_to_add_entry(ce); @@ -782,7 +783,7 @@ int add_to_index(struct index_state *istate, const char *path, struct stat *st, discard_cache_entry(ce); else if (add_index_entry(istate, ce, add_option)) { discard_cache_entry(ce); - return error("unable to add %s to index", path); + return error(_("unable to add '%s' to index"), path); } if (verbose && !was_same) printf("add '%s'\n", path); @@ -793,7 +794,7 @@ int add_file_to_index(struct index_state *istate, const char *path, int flags) { struct stat st; if (lstat(path, &st)) - die_errno("unable to stat '%s'", path); + die_errno(_("unable to stat '%s'"), path); return add_to_index(istate, path, &st, flags); } @@ -818,7 +819,7 @@ struct cache_entry *make_cache_entry(struct index_state *istate, int len; if (!verify_path(path, mode)) { - error("Invalid path '%s'", path); + error(_("invalid path '%s'"), path); return NULL; } @@ -844,7 +845,7 @@ struct cache_entry *make_transient_cache_entry(unsigned int mode, const struct o int len; if (!verify_path(path, mode)) { - error("Invalid path '%s'", path); + error(_("invalid path '%s'"), path); return NULL; } @@ -1297,12 +1298,12 @@ static int add_index_entry_with_check(struct index_state *istate, struct cache_e if (!ok_to_add) return -1; if (!verify_path(ce->name, ce->ce_mode)) - return error("Invalid path '%s'", ce->name); + return error(_("invalid path '%s'"), ce->name); if (!skip_df_check && check_file_directory_conflict(istate, ce, pos, ok_to_replace)) { if (!ok_to_replace) - return error("'%s' appears as both a file and as a directory", + return error(_("'%s' appears as both a file and as a directory"), ce->name); pos = index_name_stage_pos(istate, ce->name, ce_namelen(ce), ce_stage(ce)); pos = -pos-1; @@ -1676,10 +1677,10 @@ static int verify_hdr(const struct cache_header *hdr, unsigned long size) int hdr_version; if (hdr->hdr_signature != htonl(CACHE_SIGNATURE)) - return error("bad signature"); + return error(_("bad signature 0x%08x"), hdr->hdr_signature); hdr_version = ntohl(hdr->hdr_version); if (hdr_version < INDEX_FORMAT_LB || INDEX_FORMAT_UB < hdr_version) - return error("bad index version %d", hdr_version); + return error(_("bad index version %d"), hdr_version); if (!verify_index_checksum) return 0; @@ -1688,7 +1689,7 @@ static int verify_hdr(const struct cache_header *hdr, unsigned long size) the_hash_algo->update_fn(&c, hdr, size - the_hash_algo->rawsz); the_hash_algo->final_fn(hash, &c); if (!hasheq(hash, (unsigned char *)hdr + size - the_hash_algo->rawsz)) - return error("bad index file sha1 signature"); + return error(_("bad index file sha1 signature")); return 0; } @@ -1718,9 +1719,9 @@ static int read_index_extension(struct index_state *istate, break; default: if (*ext < 'A' || 'Z' < *ext) - return error("index uses %.4s extension, which we do not understand", + return error(_("index uses %.4s extension, which we do not understand"), ext); - fprintf(stderr, "ignoring %.4s extension\n", ext); + fprintf_ln(stderr, _("ignoring %.4s extension"), ext); break; } return 0; @@ -1767,7 +1768,7 @@ static struct cache_entry *create_from_disk(struct mem_pool *ce_mem_pool, extended_flags = get_be16(&ondisk2->flags2) << 16; /* We do not yet understand any bit out of CE_EXTENDED_FLAGS */ if (extended_flags & ~CE_EXTENDED_FLAGS) - die("Unknown index entry format %08x", extended_flags); + die(_("unknown index entry format 0x%08x"), extended_flags); flags |= extended_flags; name = ondisk2->name; } @@ -1840,13 +1841,13 @@ static void check_ce_order(struct index_state *istate) int name_compare = strcmp(ce->name, next_ce->name); if (0 < name_compare) - die("unordered stage entries in index"); + die(_("unordered stage entries in index")); if (!name_compare) { if (!ce_stage(ce)) - die("multiple stage entries for merged file '%s'", + die(_("multiple stage entries for merged file '%s'"), ce->name); if (ce_stage(ce) > ce_stage(next_ce)) - die("unordered stage entries for '%s'", + die(_("unordered stage entries for '%s'"), ce->name); } } @@ -2149,19 +2150,19 @@ int do_read_index(struct index_state *istate, const char *path, int must_exist) if (fd < 0) { if (!must_exist && errno == ENOENT) return 0; - die_errno("%s: index file open failed", path); + die_errno(_("%s: index file open failed"), path); } if (fstat(fd, &st)) - die_errno("cannot stat the open index"); + die_errno(_("%s: cannot stat the open index"), path); mmap_size = xsize_t(st.st_size); if (mmap_size < sizeof(struct cache_header) + the_hash_algo->rawsz) - die("index file smaller than expected"); + die(_("%s: index file smaller than expected"), path); mmap = xmmap(NULL, mmap_size, PROT_READ, MAP_PRIVATE, fd, 0); if (mmap == MAP_FAILED) - die_errno("unable to map index file"); + die_errno(_("%s: unable to map index file"), path); close(fd); hdr = (const struct cache_header *)mmap; @@ -2243,7 +2244,7 @@ int do_read_index(struct index_state *istate, const char *path, int must_exist) unmap: munmap((void *)mmap, mmap_size); - die("index file corrupt"); + die(_("index file corrupt")); } /* @@ -2255,7 +2256,7 @@ int do_read_index(struct index_state *istate, const char *path, int must_exist) static void freshen_shared_index(const char *shared_index, int warn) { if (!check_and_freshen_file(shared_index, 1) && warn) - warning("could not freshen shared index '%s'", shared_index); + warning(_("could not freshen shared index '%s'"), shared_index); } int read_index_from(struct index_state *istate, const char *path, @@ -2290,7 +2291,7 @@ int read_index_from(struct index_state *istate, const char *path, base_path = xstrfmt("%s/sharedindex.%s", gitdir, base_oid_hex); ret = do_read_index(split_index->base, base_path, 1); if (!oideq(&split_index->base_oid, &split_index->base->oid)) - die("broken index, expect %s in %s, got %s", + die(_("broken index, expect %s in %s, got %s"), base_oid_hex, base_path, oid_to_hex(&split_index->base->oid)); @@ -2356,14 +2357,14 @@ void validate_cache_entries(const struct index_state *istate) for (i = 0; i < istate->cache_nr; i++) { if (!istate) { - die("internal error: cache entry is not allocated from expected memory pool"); + BUG("cache entry is not allocated from expected memory pool"); } else if (!istate->ce_mem_pool || !mem_pool_contains(istate->ce_mem_pool, istate->cache[i])) { if (!istate->split_index || !istate->split_index->base || !istate->split_index->base->ce_mem_pool || !mem_pool_contains(istate->split_index->base->ce_mem_pool, istate->cache[i])) { - die("internal error: cache entry is not allocated from expected memory pool"); + BUG("cache entry is not allocated from expected memory pool"); } } } @@ -3076,7 +3077,7 @@ static int write_shared_index(struct index_state *istate, return ret; ret = adjust_shared_perm(get_tempfile_path(*temp)); if (ret) { - error("cannot fix permission bits on %s", get_tempfile_path(*temp)); + error(_("cannot fix permission bits on '%s'"), get_tempfile_path(*temp)); return ret; } ret = rename_tempfile(temp, @@ -3222,7 +3223,7 @@ int read_index_unmerged(struct index_state *istate) new_ce->ce_namelen = len; new_ce->ce_mode = ce->ce_mode; if (add_index_entry(istate, new_ce, ADD_CACHE_SKIP_DFCHECK)) - return error("%s: cannot drop to stage #0", + return error(_("%s: cannot drop to stage #0"), new_ce->name); } return unmerged; diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh index 0f2dd26f74..90c765df3a 100755 --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@ -754,7 +754,7 @@ test_expect_success 'detect corrupt index file in fsck' ' test_when_finished "mv .git/index.backup .git/index" && corrupt_index_checksum && test_must_fail git fsck --cache 2>errors && - grep "bad index file" errors + test_i18ngrep "bad index file" errors ' test_done From patchwork Sun Oct 28 06:51:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10658483 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9FB123CF1 for ; Sun, 28 Oct 2018 06:52:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E6F12980B for ; Sun, 28 Oct 2018 06:52:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D2772A0A0; Sun, 28 Oct 2018 06:52:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E25472A088 for ; Sun, 28 Oct 2018 06:52:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727803AbeJ1Pfx (ORCPT ); Sun, 28 Oct 2018 11:35:53 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:41546 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725791AbeJ1Pfx (ORCPT ); Sun, 28 Oct 2018 11:35:53 -0400 Received: by mail-lj1-f194.google.com with SMTP id u21-v6so4782683lja.8 for ; Sat, 27 Oct 2018 23:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NsUCEerIDkz++nJaJwoscgK7BeH1ybm/fBUjis/LA5U=; b=gx6dhFfBFoD0PX6iRPCJvWxtTGUN/pN7B9j1Y/5h/zmT7VmSu6YG8POAAoT16VZya5 aafCMu+j6/yHH5NV8MBqMRzALKy966k+7mavh5BiS7K3HR0Oti3hTp2lIpAEk5CDkW89 7H7uufXZgt9z7Ul8AJpOA7jFVMh1OALLQL4ElQxev+ZPFzz8Fp9gKTK3hCTojzabcg0Y QTlW9rBYkmcjMS9WNSUWsMDFMu5Gc9P0er5qCxTe8KIkvPo8/7C0j8WbaLRgBG6w/S/l lfq3GaqWByByyZ7tMUG/bjBlY5X0Xbr8TgOILHyFEr7R/pdegggyDEKsCVaxmwdajzmm nutg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NsUCEerIDkz++nJaJwoscgK7BeH1ybm/fBUjis/LA5U=; b=LH+6njlrnccoRO4YZwbun5UonrI/pjV3FiAdLsbn8TsHypOwQbu+CsjhZRTGVZRQhP 36Ixca6M65/fgWgsqvRBcYcCbWTCtSAafPdbeg1kSpcKmLTfTU8Bx3FZ0RUrcDJVOmS2 gm1VWhplbHeOp1DJbSEEGQYST6DFYLRitUqGiiW78uTa5NDOVvTPZoQCVT0uk3uFsd7V mR8rqqbg5m4NZuC6fwftA6ReZ9mMXdC8F7XHRfaxNyWkq4PuOtz0mVtQA2qlaQ1IXVkq Ul0M7T5stJtkrkcFcvPBR7BhTtlkieT1yd/MtPk8+ozKwiSFgehTrr8bBX30L1ta6nVd z54A== X-Gm-Message-State: AGRZ1gJSRskDehVAlq+ZfZD3K5m9LqX1y3tqRUrzScS4IdCg3PzvuWO5 QxgMDVxYIbe7SI3riWQyaIq3Kvox X-Google-Smtp-Source: AJdET5f3TvFqkSJ7GVdfvtxoAjAZVmGSTkU9Aw0DJ0OoXtGfGtgXJVmrelMqLPsyoJcG5cMoD8YUbA== X-Received: by 2002:a2e:9783:: with SMTP id y3-v6mr3374324lji.34.1540709528860; Sat, 27 Oct 2018 23:52:08 -0700 (PDT) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id v23-v6sm148847ljd.70.2018.10.27.23.52.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Oct 2018 23:52:08 -0700 (PDT) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: git@vger.kernel.org Cc: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= Subject: [PATCH 06/12] read-cache.c: add missing colon separators Date: Sun, 28 Oct 2018 07:51:51 +0100 Message-Id: <20181028065157.26727-7-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.647.g708186aaf9 In-Reply-To: <20181028065157.26727-1-pclouds@gmail.com> References: <20181028065157.26727-1-pclouds@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP typechange_fmt and added_fmt should have a colon before "needs update". Align the statements to make it easier to read and see. Also drop the unnecessary (). Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/read-cache.c b/read-cache.c index 5083cd8333..02a49e957d 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1492,11 +1492,11 @@ int refresh_index(struct index_state *istate, unsigned int flags, istate->cache_nr); trace_performance_enter(); - modified_fmt = (in_porcelain ? "M\t%s\n" : "%s: needs update\n"); - deleted_fmt = (in_porcelain ? "D\t%s\n" : "%s: needs update\n"); - typechange_fmt = (in_porcelain ? "T\t%s\n" : "%s needs update\n"); - added_fmt = (in_porcelain ? "A\t%s\n" : "%s needs update\n"); - unmerged_fmt = (in_porcelain ? "U\t%s\n" : "%s: needs merge\n"); + modified_fmt = in_porcelain ? "M\t%s\n" : "%s: needs update\n"; + deleted_fmt = in_porcelain ? "D\t%s\n" : "%s: needs update\n"; + typechange_fmt = in_porcelain ? "T\t%s\n" : "%s: needs update\n"; + added_fmt = in_porcelain ? "A\t%s\n" : "%s: needs update\n"; + unmerged_fmt = in_porcelain ? "U\t%s\n" : "%s: needs merge\n"; for (i = 0; i < istate->cache_nr; i++) { struct cache_entry *ce, *new_entry; int cache_errno = 0; From patchwork Sun Oct 28 06:51:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10658485 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C2D1D17FE for ; Sun, 28 Oct 2018 06:52:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3F012980B for ; Sun, 28 Oct 2018 06:52:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A8D0B2A06D; Sun, 28 Oct 2018 06:52:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EA732A092 for ; Sun, 28 Oct 2018 06:52:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727826AbeJ1Pfz (ORCPT ); Sun, 28 Oct 2018 11:35:55 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:38828 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726734AbeJ1Pfz (ORCPT ); Sun, 28 Oct 2018 11:35:55 -0400 Received: by mail-lf1-f68.google.com with SMTP id p86so1524024lfg.5 for ; Sat, 27 Oct 2018 23:52:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JvvMgAJSeswtJBb3pPBlLR8926Q83KYihev9/fULTWM=; b=C6qPZB36tc/a3OUrfZonQdaMSlB/UJSB0gRexNLQ2P8QflxqQMdxlo+Zs0kiZMx7pm z0FQMlUDwDzA1T+P2XEP0Kj13q4bUt3q7+YUXjWt3yvOHVb9T3l+Lu/H+p0yX8hj2Mw3 ps+j4CD37m1zPQzdw6cmPPRY8g4ZDh+7CJE80UPZmZ0OCoU9mEq0cUAVu0itd3nYEK+s 7CVufh2eOh5Xr/p/4sjZnHOUg4m9vdf74hqmladsOnnfbpw59jOQmazyegbVuc0wfhST g+L9B7xy+wF+BoGp0olyS/9a4ty7j3QvEe9/RNiA6sQ984/vYpgg7mam6Oqizjyy0WFW nA5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JvvMgAJSeswtJBb3pPBlLR8926Q83KYihev9/fULTWM=; b=JEDG/Xowi0fe3ryYZuR4upzEfEyXRo5ctHQPjJ9+cFoZxyu19WcD414wJtBB/aXQuX M4Y2Jf+uhLzfshOjHzOLMMia8BW3WwLqPb/BvhE6hU4HJ2iG7SAuUY5Q3tci90r/9/39 gDWCXN30rola7yihEmXqbiOnoZSxifAldFtD8l+N51KduzhHs9YA3B8LCGUpBhbxQwaO Op+jVMQf+/B8sgyXIjgNqmlD90LpLTxuY/qp9I8gakW+5+CHvzC8rUVDBoDkwtLNqRaq 6rjJ71PCDpuFFzyWrJ40CFcjtPDymZMAlT0CMjnKBDae1SGGnGdohyj5TCfhrVkVqOoe 0EXQ== X-Gm-Message-State: AGRZ1gJ82dEmzTn+/zjjAtDjnANEumoERm3LaxRdLZfG7WFEdsCwoU+B tLcAfYnDGOzjUPl4n2yXlzpMV3Vs X-Google-Smtp-Source: AJdET5f8ef/HfAbpCo+DZ/dnL1/xs+jq892mCAa8grEKanp1gKn7P9dOOIPmebph7WLBpQn7FJHl9A== X-Received: by 2002:a19:94d5:: with SMTP id o82mr5254388lfk.155.1540709529908; Sat, 27 Oct 2018 23:52:09 -0700 (PDT) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id v23-v6sm148847ljd.70.2018.10.27.23.52.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Oct 2018 23:52:09 -0700 (PDT) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: git@vger.kernel.org Cc: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= Subject: [PATCH 07/12] reflog: mark strings for translation Date: Sun, 28 Oct 2018 07:51:52 +0100 Message-Id: <20181028065157.26727-8-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.647.g708186aaf9 In-Reply-To: <20181028065157.26727-1-pclouds@gmail.com> References: <20181028065157.26727-1-pclouds@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/reflog.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/builtin/reflog.c b/builtin/reflog.c index b5941c1ff3..33cb20b7d8 100644 --- a/builtin/reflog.c +++ b/builtin/reflog.c @@ -13,11 +13,15 @@ /* NEEDSWORK: switch to using parse_options */ static const char reflog_expire_usage[] = -"git reflog expire [--expire=