From patchwork Sat Nov 10 05:16:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10676877 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 907F113BF for ; Sat, 10 Nov 2018 05:43:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C5692DFCF for ; Sat, 10 Nov 2018 05:43:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FACA2DFE0; Sat, 10 Nov 2018 05:43:08 +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 BADC62DFCF for ; Sat, 10 Nov 2018 05:43:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728893AbeKJP0u (ORCPT ); Sat, 10 Nov 2018 10:26:50 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:45599 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728567AbeKJP0t (ORCPT ); Sat, 10 Nov 2018 10:26:49 -0500 Received: by mail-lf1-f65.google.com with SMTP id b20so2806586lfa.12 for ; Fri, 09 Nov 2018 21:43:03 -0800 (PST) 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=vbg/HmGTmMkxuobaqt08V5vv/zUhOAeCBh/WiLcKz+k=; b=vaox0g70qFHKAu40pajNNv7kewt8hTHWk6zwL7rQmsBxeouImaX2y2Zoqa2hcMxY61 S7/uDK5bYwWraxWIHVBtt8xteqsI/JUlte5ePnS8zRk9tlOwh4l9i2LJJoRLDL37KAgu 12vmRjB+4nDBWeLc/3uvTyqaV49IiOaNMRq/ojCJvVC8iPFBC0IWBwere2utR/cJXCj+ 9YGmG9tjHvwW/JUpgLjUv9iKc7nN+4pNufQePP8tvYqWkU65y/vhpYozJ0PfMNxHkKJ8 QaWKPVL19Y+Xv+0v4BqCZA3KEHHpMctBkbPIOptYkXGKz91RVgkz55bAyKiYi0jESAff Easw== 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=vbg/HmGTmMkxuobaqt08V5vv/zUhOAeCBh/WiLcKz+k=; b=HbqdyNxRhLRyRbA7K5yleaqfJJrEkWYQGV+OWOiueqqvr7Fv7iAn3qEt83CPtD7ZmD N59JQaNb6HjcaCIgjraqr/fcxF6z+tDw8Z4vYQFLR+s72nYUFZJpnO9g4llh5sc1WDFF CHxQ7V+DKP4SuPW8W0X/jDJ1lpcXul74IEYWVIhjPbXMBlJCkw86MYYAhRWNaPuCYE3M kkAftWRWirHCf0y2q2T/ih1K3fvVNWjT+IKACuDiETVwA15OGCLb5NeGH8QhX1W1H/0W iF8jnBHvclsr3mq8eh3xCxNhNQREM9cr61cPhy07ew8zWoM/eDhv0qDVeDpiY9I8lcof vKNA== X-Gm-Message-State: AGRZ1gIcAuaB3W+JJwzhYZvixUAnKF/6OBz+75F1pLaX2DFIZ4f6Un+D OB1kYFqW6IFnGoj2ncyXsdo= X-Google-Smtp-Source: AJdET5dxk/8r9CeBnNxLGyfkeOWOwuh5bGiI/cca0EYMDOHgHw/2oV8wDgBoEuWrT9P4MYhaKCs5pw== X-Received: by 2002:a19:6e0b:: with SMTP id j11mr7296005lfc.124.1541826983034; Fri, 09 Nov 2018 21:16:23 -0800 (PST) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id g66sm1769663lfe.42.2018.11.09.21.16.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Nov 2018 21:16:22 -0800 (PST) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, gitster@pobox.com, szeder.dev@gmail.com Subject: [PATCH v3 01/16] git.c: mark more strings for translation Date: Sat, 10 Nov 2018 06:16:00 +0100 Message-Id: <20181110051615.8641-2-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.1231.g84aef82467 In-Reply-To: <20181110051615.8641-1-pclouds@gmail.com> References: <20181105192059.20303-1-pclouds@gmail.com> <20181110051615.8641-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 One string is slightly updated to keep consistency with the rest: die() should begin with lowercase. 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..5fd30da093 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); + die(_("%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]); + die(_("%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 Sat Nov 10 05:16:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10676867 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 9CBAD13BF for ; Sat, 10 Nov 2018 05:40:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8840D2DF7E for ; Sat, 10 Nov 2018 05:40:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 759162DFCF; Sat, 10 Nov 2018 05:40:48 +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 1D8842DF7E for ; Sat, 10 Nov 2018 05:40:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728670AbeKJPYa (ORCPT ); Sat, 10 Nov 2018 10:24:30 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:34792 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728504AbeKJPYa (ORCPT ); Sat, 10 Nov 2018 10:24:30 -0500 Received: by mail-lj1-f194.google.com with SMTP id u6-v6so3379270ljd.1 for ; Fri, 09 Nov 2018 21:40:45 -0800 (PST) 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=u607s6TBq7hhZ1r7Y5t9m5gpdBRk7PZpWS31r6MNCnw=; b=gE8mzy5VcCa2MPq99sqRihjiwPpqacpRwV+lsuQsZ+p5J5cZlgIo49Sq9wTr6TwfkA OM4zveG2DUeSXw6ZIxWQOt/65u8x16H7+JdTkyD7m+GPbkFCxeR2oY4izfhyxNVYMrRS CNQ0f2+LwzH9xUEqRzEaLCOaVntOAzEShYMZRUKwnx9jD2oedBtDLtSG1FN+/mY3kxwA /pSe0gxX3XCdMzrV7ERteRW0U9er37B0mRt2YbE0oQ+bwEdJeXRnDajp3ZjnUFR0e146 yfIWYc+wwKJYUoCqzGEz2U/4QUjT06n3o5MvKNIYcxblXc0WzSCEwcBD9yp8K98rxD8J w5kQ== 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=u607s6TBq7hhZ1r7Y5t9m5gpdBRk7PZpWS31r6MNCnw=; b=nIa4CUn8NDvtEYW72iJUvlKCfj3ibLHW9dbdrNdkhI0yfs9CBiDqTSJAKQrIUOI8pU cuog2PTQjIhF18OLwNwrKwHHxl0WHzPMWBi7r5Y40Io9e5ZF+nPzdLo6DqPxxT7W3yXF AQPpvEjNfUzein75RTDvzrfjA/H0fXKo6ot2PTPBccurtwY0+1Qg0y36+vamLPGgSrHL tjg89oWqQi2lvkrrKWcOePghldLddN3x3qWzfpgDAbLR5PhjuJG0/eFoPsjYe+YJsRSB th6xZyoJLUVfgjCQkRRmKtUR8cNJxJqt+XKUbCmVbAG/Y6kwTZLbjNtVRjRBjKKK69VD +s+w== X-Gm-Message-State: AGRZ1gKzd9u6WAXjaUith7IIupbEL8bdoygWIdcddXpOWggFhfSXGXER PkmYMc6nkVWv+wF03Sz1tO4= X-Google-Smtp-Source: AJdET5fHDFrIKPd0lNkQSWqNqhzeC6sng2/8jhtBEwwfe/HygWxTvJr13sMei1jBqI2TGZb9/9JjzA== X-Received: by 2002:a2e:9b15:: with SMTP id u21-v6mr7117623lji.29.1541826984222; Fri, 09 Nov 2018 21:16:24 -0800 (PST) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id g66sm1769663lfe.42.2018.11.09.21.16.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Nov 2018 21:16:23 -0800 (PST) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, gitster@pobox.com, szeder.dev@gmail.com Subject: [PATCH v3 02/16] alias.c: mark split_cmdline_strerror() strings for translation Date: Sat, 10 Nov 2018 06:16:01 +0100 Message-Id: <20181110051615.8641-3-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.1231.g84aef82467 In-Reply-To: <20181110051615.8641-1-pclouds@gmail.com> References: <20181105192059.20303-1-pclouds@gmail.com> <20181110051615.8641-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 5fd30da093..c7e122cfc1 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 Sat Nov 10 05:16:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10676865 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 0899E17D4 for ; Sat, 10 Nov 2018 05:39:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBE142DF5E for ; Sat, 10 Nov 2018 05:39:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DFF3F2DF7E; Sat, 10 Nov 2018 05:39:49 +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 8B3F12DF5E for ; Sat, 10 Nov 2018 05:39:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728760AbeKJPXc (ORCPT ); Sat, 10 Nov 2018 10:23:32 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:33685 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728548AbeKJPXb (ORCPT ); Sat, 10 Nov 2018 10:23:31 -0500 Received: by mail-lj1-f194.google.com with SMTP id v1-v6so3384325ljd.0 for ; Fri, 09 Nov 2018 21:39:47 -0800 (PST) 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=ca1xoImJksMtB7vKPj0M7/OEb9ORCFbH9k8Y3MVP3lU=; b=bn4aBEp7Lj3ZGZmaC799CdI+a2jYg0A0XPrVqoWiJmbbloaHcE9/IBJY6T0e0hj+KE nPzNi3uY14T136LlRy7zSjtD60WWzw71HdXZ4H5Cq8AArBoie9GHFW1g/YJAukteBP1G XkRjicjtWjEwKLVYp6O3lFcRtp6vcKZ2XE/9NOerKWtR8rxHfyWddVGtbub9tiJWAigG MSplzjTYJxuMxLU46ieGPS1ECQTc7BJjNVOwfI6Vb4D856mvu2JbVkhdwojNX4iHDwS6 7BW5FCgQa+KZaGYRRMCwfDopiEk7Y1nBtWVGk2hNC/ziLYMtfGAKZUXKIymnOTAPaykk uhNA== 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=ca1xoImJksMtB7vKPj0M7/OEb9ORCFbH9k8Y3MVP3lU=; b=I0ZvA3xjYycrTqBMPilDg/Q+W6w6U2WgkSn1jKgblJ+nlLTZidxoM4nZuJgLk5VCFl vzpCNLyVL0/qU2xHA/OkCPVkxjsQCbDNlJrhsRcSLCWorbkhBYC/fOnLKfNarv/G2+uY eUJgTctGcljxMt7O0EANKIMm5JlWrl6GMs1tz3FMytSVunAbetTksU0OjhLPZAO4an4w GiHveO2Y/t0CXl/Om0EGx62eAOPQLjITecGUFFSbEJ2VQKywGJXnz3bgBilBTuWwTfBF dWtaHZyja29ZNTbQMEbRLFi3Ntk/97jevbsI008as+qzJFPomX6EeTxOrfFbJwJphQsN cEzA== X-Gm-Message-State: AGRZ1gI/0hT51SP9zlM9Cz4nhLNZEVZXSS1kWz9euQhmg8JjvtFWa7Qd f4wpy2WcV1RqvRRmHjOdW44= X-Google-Smtp-Source: AJdET5fsnJd9VJeKMKQAOLsNPFe9VAYoHZCrM8b8zOn36R9zwzfwKjLgdcJj5h9ByBU91mwb9yF4Kg== X-Received: by 2002:a2e:4745:: with SMTP id u66-v6mr6934775lja.37.1541826985737; Fri, 09 Nov 2018 21:16:25 -0800 (PST) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id g66sm1769663lfe.42.2018.11.09.21.16.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Nov 2018 21:16:24 -0800 (PST) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, gitster@pobox.com, szeder.dev@gmail.com Subject: [PATCH v3 03/16] archive.c: mark more strings for translation Date: Sat, 10 Nov 2018 06:16:02 +0100 Message-Id: <20181110051615.8641-4-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.1231.g84aef82467 In-Reply-To: <20181110051615.8641-1-pclouds@gmail.com> References: <20181105192059.20303-1-pclouds@gmail.com> <20181110051615.8641-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 Two messages also print extra information to be more useful 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..d8f6e1ce30 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(_("not a valid object name: %s"), 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(_("not a tree object: %s"), 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 Sat Nov 10 05:16:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10676869 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 9622013BF for ; Sat, 10 Nov 2018 05:41:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 855672DF7E for ; Sat, 10 Nov 2018 05:41:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 78BA12DFCF; Sat, 10 Nov 2018 05:41:02 +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 2096C2DF7E for ; Sat, 10 Nov 2018 05:41:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728722AbeKJPYo (ORCPT ); Sat, 10 Nov 2018 10:24:44 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:44261 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728504AbeKJPYo (ORCPT ); Sat, 10 Nov 2018 10:24:44 -0500 Received: by mail-lf1-f65.google.com with SMTP id z13so2808591lfe.11 for ; Fri, 09 Nov 2018 21:40:59 -0800 (PST) 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=oHBFgH9ML/AasrGcZbij/HIUVPSxIbs0Ds5VfXDIWrw=; b=QxhX1qFOlqQm38nNRzIcvYRLbQVz47TqvcSgobdS9PK3cdkN97NVB/3DBIfkOwmiKv p4A1Xu0sRp/XH9jOb0QMSFJQMICzbd22ZtJnAHNxKQ37IRdBBisgfg/zD805ohViCZAc FNTJ9jse280Iz4pEBiLp9BRqa2GBsTQ6oA5QB70R8RTLONWGoDv0ejn/LsoN/AajWVFy prDhxeNycBMfoH1GeO0B/W+Wtnv8qiML/EFH6brquAsjDTf0HtW95Aefk20/PoCEuoOr bQu4awLn7Jg76nGGAGzwJofNzvTda2A0LjnJlqU4FaAOWwXP0JWbgmjmaZyJvqoBYSUP F68g== 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=oHBFgH9ML/AasrGcZbij/HIUVPSxIbs0Ds5VfXDIWrw=; b=nnhmfvEpHQlliaIJme1eZbmBpLmufELKfOvWr7V9mIvD9Elf5oHGsTkZk1DEIJ2j5E 90MiH4pz8q8tNfDAhiQX56AJTTSjnWSl3saX5JeWdj/AbyLrUCcQ+lmjohtZRRnR6uU3 57x72dmv60CzHwIeaYHnWVUo9m/+t7zFd9ZY9XS+iWm7ocai5mh+ALM0yNpusKiGZi0o m77uDDK4nz8iFAV6dLbnMYrJaWZr53odq61bfZAx98DJ3uerORbmPxFQIwFG5lmWUGu+ dcie4ENomhUZSDG94tfwRXAdDSkrVpIwxmR35yswX9rQ1b5RcNrQEuc81uOFozUZe/n+ i+Nw== X-Gm-Message-State: AGRZ1gK4COC1ujndRl5nvpquCa8PeTXfTwAoVdE2+X7EaybHPw/3wvWG jx5Gr1rvCwr/OqIe46OtdGo= X-Google-Smtp-Source: AJdET5fxsuRxrAdMn88k/WNLFXvkA40L1+LT+N1Ox0m5VKLQQpoFHvlroyW3DXYU4KkOzWeNj/RYKQ== X-Received: by 2002:a19:c7c2:: with SMTP id x185mr7272248lff.123.1541826987051; Fri, 09 Nov 2018 21:16:27 -0800 (PST) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id g66sm1769663lfe.42.2018.11.09.21.16.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Nov 2018 21:16:26 -0800 (PST) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, gitster@pobox.com, szeder.dev@gmail.com Subject: [PATCH v3 04/16] attr.c: mark more string for translation Date: Sat, 10 Nov 2018 06:16:03 +0100 Message-Id: <20181110051615.8641-5-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.1231.g84aef82467 In-Reply-To: <20181110051615.8641-1-pclouds@gmail.com> References: <20181105192059.20303-1-pclouds@gmail.com> <20181110051615.8641-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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attr.c b/attr.c index 60d284796d..3770bc1a11 100644 --- a/attr.c +++ b/attr.c @@ -372,8 +372,8 @@ 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", - name, src, lineno); + fprintf_ln(stderr, _("%s not allowed: %s:%d"), + name, src, lineno); goto fail_return; } is_macro = 1; From patchwork Sat Nov 10 05:16:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10676881 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 0642513BF for ; Sat, 10 Nov 2018 05:43:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAA362DFCF for ; Sat, 10 Nov 2018 05:43:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF3D42DFE0; Sat, 10 Nov 2018 05:43:24 +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 824E42DFCF for ; Sat, 10 Nov 2018 05:43:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728910AbeKJP1H (ORCPT ); Sat, 10 Nov 2018 10:27:07 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:46773 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728903AbeKJP1H (ORCPT ); Sat, 10 Nov 2018 10:27:07 -0500 Received: by mail-lf1-f68.google.com with SMTP id f23so2806839lfc.13 for ; Fri, 09 Nov 2018 21:43:21 -0800 (PST) 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=aPfYpgWuqsllTsgO4pqsrtMX4jmXCTuYZuwiZBIGK18=; b=Mr3u3uUsT/1p8kxRTwSRu6UkosuKewFMJGlrP5lPZ4bCXrO+uHt/x0vJBEPUgYGyKk 2lZsGYxqImhylgsQFIfjRpaVuWCbv8fUIjPACuSfSAiZJBth/NM9uu9jgN+6eAc5y2V5 JEVTJiYGoGeEjTKAYX179Ru+HON5Q2XIH0l9fxi20NlF5BLImdFbCYvGKCC2z0RwqZjm UdRlLg1GWXmR9G4RVLb6mEnXdXrluNNSfvpLEStxOk/47QC5GNHU+s1KfpD3q5ZcTkFB Q5LGtEV9uWicctv4JV65ycbd4EGmo39oHhfF9VNxWYyq9CleSYjt9kr6YZIr91513LNF OMEw== 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=aPfYpgWuqsllTsgO4pqsrtMX4jmXCTuYZuwiZBIGK18=; b=sz/s6LX5KkSBUOvuJOTo5KJirooFO6fNpibxVitiGVVFU5ojTlKY+Oi+1wkJRNK1oN Br83RZIczYvHCOHsbBMscr9jyfNCoETmTZsVD6aH6CUsRpufiHQkgxZS0VFaTwGETVlP HvFc9hMhWJ3XJB+4WcBAbF94GMOAnfYo6anpDZDRcb4B+C8K6laftLK1Vb9CoKfOSXEM Q8M/2ydTrlZi3Da0pnJTB2N3uq883+8uDlsXfNgzr/29xOHDMF1Up1HK+F97geDX7jpN EwRpRe+bV8Qol+emb2p9zm1M1UY0Dl76SCJkhaxXMlipMocaN5R9Zuo1k25MgLnJjTJu i/yQ== X-Gm-Message-State: AGRZ1gLcQ39sblDNc1Y5zw6SRiS787OEyxUftVZ1iw9HlDkKHIFeLNWp cieUD4HBu1lTFqL4fRB+Zxo= X-Google-Smtp-Source: AJdET5cKAKKDaind/EU/qQ1nGmWRs51fZg6wgn7iJ9V76Xff03qzzQJAlwEGVA/A8o03BrSVXxmERw== X-Received: by 2002:a19:945b:: with SMTP id w88mr6581361lfd.15.1541826988106; Fri, 09 Nov 2018 21:16:28 -0800 (PST) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id g66sm1769663lfe.42.2018.11.09.21.16.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Nov 2018 21:16:27 -0800 (PST) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, gitster@pobox.com, szeder.dev@gmail.com Subject: [PATCH v3 05/16] read-cache.c: turn die("internal error") to BUG() Date: Sat, 10 Nov 2018 06:16:04 +0100 Message-Id: <20181110051615.8641-6-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.1231.g84aef82467 In-Reply-To: <20181110051615.8641-1-pclouds@gmail.com> References: <20181105192059.20303-1-pclouds@gmail.com> <20181110051615.8641-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 --- read-cache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/read-cache.c b/read-cache.c index d57958233e..0c37f4885e 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); @@ -2356,14 +2356,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"); } } } From patchwork Sat Nov 10 05:16:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10676871 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 7671814DB for ; Sat, 10 Nov 2018 05:41:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6611B2DF7E for ; Sat, 10 Nov 2018 05:41:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A21E2DFCF; Sat, 10 Nov 2018 05:41:11 +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 6F0692DF7E for ; Sat, 10 Nov 2018 05:41:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728736AbeKJPYx (ORCPT ); Sat, 10 Nov 2018 10:24:53 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:40850 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728504AbeKJPYw (ORCPT ); Sat, 10 Nov 2018 10:24:52 -0500 Received: by mail-lf1-f65.google.com with SMTP id v5so2824829lfe.7 for ; Fri, 09 Nov 2018 21:41:06 -0800 (PST) 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=3GbbkVVmPmzceUecZNVHl+e0wknv/it3q/VrN3+OH9c=; b=XV9Lg4WJkhDLOA/WBfPRVHeLp7Qm94vPgtBG5YJY8Rxa2QxlV5EkXeasr6pr73DL4Z 883oGmmX+4umTLHibDMx/PalTDP4fUCa8fylmkI3oYdGQRm9nRNtIRym+BUSNCc2oSxV DBd+arTS0hcnUO/fRJ3I1Dm+AgRt0kgAziHGNjv2jHMuTPoVo7uxBTMN5ohkdYRTZeNq AaqbJjYBGZ/nbA1mwYDvW6w3RLxh/dby17Y7z8CNSpnMm89zQC2YSXCrb9o/RcI0qfhe ft0EWEowNOEB1IkHmVIea6sP4fT44GpE2Q5LK98isfiBDoPj8BFQ8/5ZLiGSMF1hYKa9 A0aw== 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=3GbbkVVmPmzceUecZNVHl+e0wknv/it3q/VrN3+OH9c=; b=Nov8VhKCVSrrgJvPYVYUcYv3mkxBRrhX2+LJxDeqRiGA5GvqC2AF3Bi/Xv0wNqaUNI 1yddtW35xSRuRoj7c9ZFj7oSf4vvyXKNuvsfxQr0nLxjsbvhBiKxmkHAR/f5tOGMml34 0YfmicS+2bdBnQAKVGiDgf4Xdz57Bm8L/W7hHqxCtAGY79A3xYlJHr3Rblqz8dsYEQgJ tEG2mvRcxQjoDXlXM7uEaaq8orFh1Ceq40I4jNs146mJUwkXE0EDQlJ3MlgR4Yoa9fs4 E1JqTV7JAHSvvZewp/wYXOlJZnn8aqlFKuAmJ0lJMYMX0oOEspxC7k9WRu07+TacOAKs 7Pcg== X-Gm-Message-State: AGRZ1gK9h1wh2ZEF6LvWIe4Grz9u5ubCchIfgv/bW9G4SCAU4x8n0orA DcbmR03xtiA1p9hJB46ieCo= X-Google-Smtp-Source: AJdET5dGLH61O5Yo8usrkX8YIG0Ar5s4be7R6cCnacrgODm3v+/c9Zij+kGrDpY4jEkAoo2f2H2lyA== X-Received: by 2002:a19:5a05:: with SMTP id o5mr7375322lfb.140.1541826989141; Fri, 09 Nov 2018 21:16:29 -0800 (PST) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id g66sm1769663lfe.42.2018.11.09.21.16.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Nov 2018 21:16:28 -0800 (PST) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, gitster@pobox.com, szeder.dev@gmail.com Subject: [PATCH v3 06/16] read-cache.c: mark more strings for translation Date: Sat, 10 Nov 2018 06:16:05 +0100 Message-Id: <20181110051615.8641-7-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.1231.g84aef82467 In-Reply-To: <20181110051615.8641-1-pclouds@gmail.com> References: <20181105192059.20303-1-pclouds@gmail.com> <20181110051615.8641-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 Signed-off-by: Nguyễn Thái Ngọc Duy --- read-cache.c | 57 +++++++++++++++++++++++++------------------------ t/t1450-fsck.sh | 2 +- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/read-cache.c b/read-cache.c index 0c37f4885e..858befe738 100644 --- a/read-cache.c +++ b/read-cache.c @@ -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)); @@ -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 Sat Nov 10 05:16:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10676873 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 E764A14DB for ; Sat, 10 Nov 2018 05:41:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D33912DFA8 for ; Sat, 10 Nov 2018 05:41:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C56462DFD6; Sat, 10 Nov 2018 05:41:43 +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 7549D2DFA8 for ; Sat, 10 Nov 2018 05:41:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728682AbeKJPZ0 (ORCPT ); Sat, 10 Nov 2018 10:25:26 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:37039 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728504AbeKJPZZ (ORCPT ); Sat, 10 Nov 2018 10:25:25 -0500 Received: by mail-lj1-f196.google.com with SMTP id e5-v6so3375622lja.4 for ; Fri, 09 Nov 2018 21:41:40 -0800 (PST) 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=YLAtDCp0DggVMXDfnq6UmjNIo6HS2SUNb0DLXoU7lRo=; b=fjtkDaAAOzMO0/6aEfxjf9H5Ey1+EfB+hS16CTrWYPi3AETGCKy4ibGO2w23VbKlvT 2L5HxYgq7nv1ukVbwoJYRbVPDBVp+VWX4fQdG5ZfLSgXoQnkqspN7oPIYA3zIilPff6Q 2/z2PrzrKYQCege2Q0if0NWDL0n//MW0VBcbjXzQ9l3MKf8YXO1P3CxbjTRjV/AjIP+I uV9TpuVIvpjhyIJWXtp3M8gUnBXhfeNVktLVrX9iPELjRGfZMuOCLb1zDRdxybwsIiR/ 0BlxHDD8wRC5Mdo9DA1Mt9nMh8Pi9baHgd93+8zPBm+60aLqTkhOsL9tZc8aiqynSVWe ueKw== 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=YLAtDCp0DggVMXDfnq6UmjNIo6HS2SUNb0DLXoU7lRo=; b=XST8FlI6YfrNqozOg13vhTyM0D0/OJdsJ0+JpUZ9OgtkLeC+9z0Po5OMmchg7Zh4qF mv8j4eGg+mX/iU/vE/8m/aYWH2BTyD5TGbv3TD42IY8MZUI60xCIOyQO17FoPqEd6NpH qDqpWsdK7qmQ4Nsv9Ib9BkigWlAiZu1KezdcNmy5xTVwYsbxsaJQsGchfjGtQsbJ9853 Gp7S2GXuLjvxCyGXAWmBUJ3DbXsXkW5PRbq16e034Dqo9fkUWnZ6pnKYnbarAKm7+FHZ lZ2JreDdmLQuh6knZsE9XXwDd032RPmvEoMVUaskqlavyUE+UrII1F4ziv9hTSZWFHCq JZrg== X-Gm-Message-State: AGRZ1gK+pSCJaBxRh1lcCRbfWnEl7C1XYDtE9WlXzUQIs2HpovLc80IH tqC67UYQJEqInxTlZQZUU+w= X-Google-Smtp-Source: AJdET5fCo+PceIrh0pIcGmEeXB3vMJEYKxavdt7ksXX0UWjZWM/IqgipsNfPfutk5NP/VlV0azQ81w== X-Received: by 2002:a2e:55d3:: with SMTP id g80-v6mr8110107lje.78.1541826990099; Fri, 09 Nov 2018 21:16:30 -0800 (PST) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id g66sm1769663lfe.42.2018.11.09.21.16.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Nov 2018 21:16:29 -0800 (PST) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, gitster@pobox.com, szeder.dev@gmail.com Subject: [PATCH v3 07/16] read-cache.c: add missing colon separators Date: Sat, 10 Nov 2018 06:16:06 +0100 Message-Id: <20181110051615.8641-8-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.1231.g84aef82467 In-Reply-To: <20181110051615.8641-1-pclouds@gmail.com> References: <20181105192059.20303-1-pclouds@gmail.com> <20181110051615.8641-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 858befe738..8d99ae376c 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 Sat Nov 10 05:16:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10676903 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 B2C55109C for ; Sat, 10 Nov 2018 05:48:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E3842DD63 for ; Sat, 10 Nov 2018 05:48:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BF332DD8C; Sat, 10 Nov 2018 05:48:53 +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 9156E2DD63 for ; Sat, 10 Nov 2018 05:48:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728722AbeKJPcf (ORCPT ); Sat, 10 Nov 2018 10:32:35 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:34158 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728659AbeKJPcf (ORCPT ); Sat, 10 Nov 2018 10:32:35 -0500 Received: by mail-lj1-f194.google.com with SMTP id u6-v6so3386806ljd.1 for ; Fri, 09 Nov 2018 21:48:48 -0800 (PST) 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=PhbCYGASniDW1U0xw1uPf5kqCdgNyEcxbXAcgyq59hE=; b=m/B8WzOJ5oO9qivSREboMv0Wys+KVC3O45EltHHIJn8/bjKyMyuzlCxkwX3tYZS3sF mPUJovSngDucZRXgpTQ+lFGVW6Z1gb3YSdBimQlLH4seBUeqfNi6gWmT8Mw8niNZElPO xnRvshKfYkSsu03ombq37/pHZyWiFEhx3823ZxN3Zb9V5QiSDXi/QuIQn7cWxCfbwtUr XukY3WKfMKCYQCEhka/yYsKO++NptxkiRaI8q4zqbN+E1SlUWCysJ7rkyaMShEyxZNNJ 5UUOqnW8mHhw1MOpJdCTwiYaq5DDm1o2pexl2siLY6ngv3Wp9PJf3zVB0Ou6GeVMzRpS MPwg== 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=PhbCYGASniDW1U0xw1uPf5kqCdgNyEcxbXAcgyq59hE=; b=PCoDF/O7MbjHypX7W5w3Oq6I8UCcIJww5b9VKbr0MJQEzKoP50zqerYBF7fNOj8RBL uqP7DN5REr9WI3A689d0oxZnz8HP1KsMz5L1GpdcsBGPQRFcJ4uDIt5Ln28vuqWdV0bH HQfnXx7Y9rpfdMmCm4e25xtv9ifGZZT3Dr2Vm0MeDZnb89JmyOFQYCxRvDTGbL1U/QM6 T7BkrS46SvHokW8It3NyFbdZLOry9qsUcKo2FC7nI87fCUuZZO27XvjucHoLfhyDM7vk mWQPMlpO8N70KRK0ItQpHVhjgLrAcUvFQfZGnBZdrnS6kmS1ixuspz9xtlfY4ttvQgO5 caYQ== X-Gm-Message-State: AGRZ1gLc+tULUc0IuWN7tJfAcrqDP5eCtZDJhQjiNcbXz3cIjfFn4Fdn j55M1SXmH18LQ71QxO2N7YJ1yQr7 X-Google-Smtp-Source: AJdET5dULLCskaeXPFs8WXriu7DtR8UzvgG4zfNVQKZwG6sPfbbP864/5dPxvc+sP3FrKW72tiXdKA== X-Received: by 2002:a2e:e02:: with SMTP id 2-v6mr6266125ljo.10.1541826991234; Fri, 09 Nov 2018 21:16:31 -0800 (PST) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id g66sm1769663lfe.42.2018.11.09.21.16.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Nov 2018 21:16:30 -0800 (PST) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, gitster@pobox.com, szeder.dev@gmail.com Subject: [PATCH v3 08/16] reflog: mark strings for translation Date: Sat, 10 Nov 2018 06:16:07 +0100 Message-Id: <20181110051615.8641-9-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.1231.g84aef82467 In-Reply-To: <20181110051615.8641-1-pclouds@gmail.com> References: <20181105192059.20303-1-pclouds@gmail.com> <20181110051615.8641-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 One string "nothing to delete?" is rephrased to be more helpful. 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..5a74ccf7ab 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=