From patchwork Mon Nov 5 19:20:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10668997 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 0BC9315A6 for ; Mon, 5 Nov 2018 19:21:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF4FD29C0E for ; Mon, 5 Nov 2018 19:21:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E362929C53; Mon, 5 Nov 2018 19:21:10 +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 7858029C45 for ; Mon, 5 Nov 2018 19:21:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387760AbeKFEmR (ORCPT ); Mon, 5 Nov 2018 23:42:17 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:44172 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387409AbeKFEmR (ORCPT ); Mon, 5 Nov 2018 23:42:17 -0500 Received: by mail-lj1-f193.google.com with SMTP id k19-v6so9108695lji.11 for ; Mon, 05 Nov 2018 11:21:07 -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=yDVPCNBg8si75m/HCwWEHvx+0vw+vX26vcFCs33Cqzo=; b=KUz6zovgFizJ7yPAEJt2HCrP7XF9yUf5SR7gQLGi9QVIdX37qD75Zlr4teKW6lBLGz IIGGRLsRw3nMZ63++f0Y59ouG0lDJAcX4S8dZkU9yms4EkGA7+ZoSy7EOqkOFK25UbkK efc9uWq2LelL9eajKEJ5AfKfzt3CzSUOAH4GoiVmKqceSkVynbe0fQNdLJR/DZhfAPq1 Iof0GvVHIDXfHblwiB5EW+hAKG+Yl542838F3WM/fHL857mT9RHWKxHOvyBrh8OZ6ZQC Edz2IxuUNTvoHXcAFiLflRUFGdrYSzbHICerGKBy4HwOhqYbHcEpfVo8ejeHRFJaefpz hT4w== 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=yDVPCNBg8si75m/HCwWEHvx+0vw+vX26vcFCs33Cqzo=; b=ICj8xrifDyWzavmNv6l2ePiNnvtGv22eMG07NRC2VFKG+zp5OwZdl0H7THA0uPEm9P Z5mSctvNndMThxCDYkWvg8TUO4pJAGk5GKbveN9XfWG7sHITvf/tiHgs9r3afZwmMWpO FekURAalmAgE9phxeh+P5jGkiiwBj1uB6fJCV0iiM2QQUCzozeAelqjrVahOiqqnYqfI hPWzMAKMoFExacUpOtOCRtLCCyPOXimWNTnChk8fajXV2uFRnbIhnEkbyMHMNPoOJ+lN XxMxc81JFkScXVzTEtAiHEr97XupePvX4i6zjbm/r1cAaSZ+RN8PUL4AAdyFdZNhJI3T zQoQ== X-Gm-Message-State: AGRZ1gKN0KC1bFsNB8jwUCyi9JwMfu9+taNv2djjJ0RlNozKDeSDfEza 27FM1qTFW1zuF+VsY9xC9Kk= X-Google-Smtp-Source: AJdET5eGF4A6wRZAiI7wvgP7NVSqNNvBNbanLomlWVzT7vs08UBOh8++zFiyuQJ7t+5kNiWZmxKzwQ== X-Received: by 2002:a2e:851a:: with SMTP id j26-v6mr5019716lji.163.1541445666878; Mon, 05 Nov 2018 11:21:06 -0800 (PST) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id x5-v6sm3591056lfe.58.2018.11.05.11.21.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 11:21:06 -0800 (PST) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, Junio C Hamano , =?utf-8?q?SZEDE?= =?utf-8?q?R_G=C3=A1bor?= Subject: [PATCH v2 01/16] git.c: mark more strings for translation Date: Mon, 5 Nov 2018 20:20:44 +0100 Message-Id: <20181105192059.20303-2-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.1005.gac84295441 In-Reply-To: <20181105192059.20303-1-pclouds@gmail.com> References: <20181028065157.26727-1-pclouds@gmail.com> <20181105192059.20303-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 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 Mon Nov 5 19:20:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10668999 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 6F49D18FD for ; Mon, 5 Nov 2018 19:21:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DCA129C11 for ; Mon, 5 Nov 2018 19:21:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50AB529C5E; Mon, 5 Nov 2018 19:21:12 +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 CB01C29C11 for ; Mon, 5 Nov 2018 19:21:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387851AbeKFEmS (ORCPT ); Mon, 5 Nov 2018 23:42:18 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:46529 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387556AbeKFEmS (ORCPT ); Mon, 5 Nov 2018 23:42:18 -0500 Received: by mail-lj1-f196.google.com with SMTP id v15-v6so485141ljh.13 for ; Mon, 05 Nov 2018 11:21:08 -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=gXrum+GJ3eIOgPD9srO44Fn45fwUBNViXcYzKNm0QN4=; b=CZ55GCc3t1JBCXNuFVTIpE7Q1FyYa7LV1LruDPuvAoiK/++v6Gx97aSiwfwCF374kN /d8doHadG+cNahstTqeDeU9cEv6RzZNh6JwlzCGaSzMgXYQAFq+oyuvy0XMUo3IPnID6 lNkmQNS994wdo697rOXJfXgBTb0O2fkZuTCHSScTKEyeapw3TD2QKqdnBBIalAqAwWnG CrPof+3PgNRP7OAhmX2QESCowk2k4D5+E7yKAzIqzxp//yEBQ7Oe4eKaYVm/Vlt32C4P ssGsSaDF1qKx/3AGfmPoUB4Wgcb19VOR9J/RwZrrmh6NUC0aRrDfH8Vp+pr2yP7Con05 i+Wg== 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=gXrum+GJ3eIOgPD9srO44Fn45fwUBNViXcYzKNm0QN4=; b=CV7d8UTW3lBJ7iIK3JIPWiJMjB4pXejFHsSZSJDu6eRcbMD3u1WRKHUH39o6qnsYss gGI+satjMVVqjipAyNRTag2UhcoWAiQCRSwNZQEcpUIsCnBFvvmIIjrLoRFLHhgNk/EB LVlzuqDDDTBFOiHBoXkFdEBLWqo3dip+VFxBZ1RECiRw31hGIok0Nx3aVVxXQO0EUg70 N6WdKjfKR1zMUjXqSD6QK6URXdE3oRoq1r+XjFQ2lfFcrrf/sMFcxuuiyllfjhcq9yf3 ypCZC3vGlaGKDABK4oTc5V5H8CxPGh4YXEwZgaqLl+RMaWSuYqfNBhqH5G4PoEq+GQj2 6lyQ== X-Gm-Message-State: AGRZ1gIv4sFA4e9GqvOr8tjdVjwP3vpuGgXHLSi8WynXiqjIrje7+ciO G7LvpTa4ttpDHhi5tTy8ukQ= X-Google-Smtp-Source: AJdET5cQDf4MxeevXVXxdxveUZe24RtaQRM/zd8B6y7N8rj2MHxxImycHdFYotC5tMfDu/+wV58bbA== X-Received: by 2002:a2e:2b99:: with SMTP id r25-v6mr14812037ljr.91.1541445667947; Mon, 05 Nov 2018 11:21:07 -0800 (PST) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id x5-v6sm3591056lfe.58.2018.11.05.11.21.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 11:21:07 -0800 (PST) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, Junio C Hamano , =?utf-8?q?SZEDE?= =?utf-8?q?R_G=C3=A1bor?= Subject: [PATCH v2 02/16] alias.c: mark split_cmdline_strerror() strings for translation Date: Mon, 5 Nov 2018 20:20:45 +0100 Message-Id: <20181105192059.20303-3-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.1005.gac84295441 In-Reply-To: <20181105192059.20303-1-pclouds@gmail.com> References: <20181028065157.26727-1-pclouds@gmail.com> <20181105192059.20303-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 Mon Nov 5 19:20: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: 10669003 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 DF54F1803 for ; Mon, 5 Nov 2018 19:21:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD69929C53 for ; Mon, 5 Nov 2018 19:21:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C20E529C8B; Mon, 5 Nov 2018 19:21:13 +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 6D99E29C53 for ; Mon, 5 Nov 2018 19:21:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387928AbeKFEmU (ORCPT ); Mon, 5 Nov 2018 23:42:20 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:40067 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387409AbeKFEmT (ORCPT ); Mon, 5 Nov 2018 23:42:19 -0500 Received: by mail-lj1-f193.google.com with SMTP id t22-v6so9117689lji.7 for ; Mon, 05 Nov 2018 11:21:10 -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=PnYWc5zwuti8CEyNhFPtqk7nCTJ7E2m/CvY6Hlsk03k=; b=C61vnUgtF8dh4qG16B5/SjKW4CbrBY7/ZmBwAEbBCRIWn5u8uXNEbuTFHMs1s53u4k 5YeBDjAQf5Xh4ftDEq98gGCY0onMNBH0hllCD6Z0+pPhq+bv45WSAWdHQ6tjihjRVNue W84LRG8cZBL64KbOq5QCkegmmtsBygtZIMH/mUi3tpf8WyFUCWNR1YPpKBKbZ29M92mh xL5mje6mpXWXHWLfkcDXGreDwEhA3kLkLUlrtPjwhL3XM5JsRHdpdJrwW8qI3BIDNYvY eTSXwqmu2S7/kIrPHaczpJ5wtrLknjqIyj6mh3UACbKAap3W1mD+WcvhpksYnvjwU42m JZ6Q== 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=PnYWc5zwuti8CEyNhFPtqk7nCTJ7E2m/CvY6Hlsk03k=; b=mhcvjJ17CY97/ff5E/yUqct9GZl1uAL/87ag7E5xDiW+nP7dhbEvwXsI+ntC9GTgpa ShPRLx2eCrY0unK7NyBPj8E6Ob0KKt2Y9YHFvBJzFRxU10/3BqRY2YZWN8IDHhexzfIT y9CRBiyEvywNLGOBaMZQe6Fm+yIw0NO3rSfiD5HxwE6ziV3bVvhOPKSM7zq58bP3yjp9 xRGCsLRSfFIGAwqUDkRZVOPoTBxiNDJ6JpnO4SPfbA5z5r6iW/ghA53hRQ2OroyInpBl QHlPpgckH2xVJaxT464QtYI33w0LjoLL+fFd9TeZQ5V0TrE9ypqY/hKVc22PuetRy0eh AybQ== X-Gm-Message-State: AGRZ1gL0ToVnPXcUrrIgO3RW4Q+6YcGKEtOZdkU8r+M1ooI9bpUdMzvd LDIysvFjfIy2P1uDFrgqngobgYW8 X-Google-Smtp-Source: AJdET5ex0HRp09NMX8ShWtfzwzBdfGBlkIxuyo/mxC9gNEarECQuk2+lP5IEhE2gZSkYOP2oVtlOFQ== X-Received: by 2002:a2e:5b93:: with SMTP id m19-v6mr12893705lje.115.1541445669228; Mon, 05 Nov 2018 11:21:09 -0800 (PST) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id x5-v6sm3591056lfe.58.2018.11.05.11.21.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 11:21:08 -0800 (PST) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, Junio C Hamano , =?utf-8?q?SZEDE?= =?utf-8?q?R_G=C3=A1bor?= Subject: [PATCH v2 03/16] archive.c: mark more strings for translation Date: Mon, 5 Nov 2018 20:20:46 +0100 Message-Id: <20181105192059.20303-4-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.1005.gac84295441 In-Reply-To: <20181105192059.20303-1-pclouds@gmail.com> References: <20181028065157.26727-1-pclouds@gmail.com> <20181105192059.20303-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 Mon Nov 5 19:20: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: 10669005 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 8176B1932 for ; Mon, 5 Nov 2018 19:21:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F79029C98 for ; Mon, 5 Nov 2018 19:21:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6403729C71; Mon, 5 Nov 2018 19:21:15 +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 1782B29C5E for ; Mon, 5 Nov 2018 19:21:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387950AbeKFEmV (ORCPT ); Mon, 5 Nov 2018 23:42:21 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:35164 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387556AbeKFEmV (ORCPT ); Mon, 5 Nov 2018 23:42:21 -0500 Received: by mail-lf1-f68.google.com with SMTP id d7-v6so7033211lfi.2 for ; Mon, 05 Nov 2018 11:21:11 -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=X9f93GFvnJNaMUSCqBeJf25Zr08F9PQE2gHBLTTBeU8=; b=QnOiorUaeaQT/zT1Z35qXxRHfJNO2K2tt7Ktc5yCQFmPgHsWH2UDaD/Ydza9Ywr2VF N/yuCL0oFrvebTvU7IvbdHg1fpemPly7nU2ImcMn5qnflWZhvLRF020TY+oujsq6lZ54 KptoP+kGytVj6WkKRSJ8DN05i/u6qXcQ9y4fnTgBKWYMlDTHzBqbOpdHh0WC0mZRvhwc 5xzxCW39IKqwvq25nxAyo18yI2glQg8fFkmwGwS6Mz87dttlkFqFhz8aIQqi9z/unF9w P7Dpc8l0c9D6wsHlDKdxBmIE6xd8FcMMjjHSqi23JhaymeVo6hsJGH4iaeqLvVhAjjxt 95bg== 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=X9f93GFvnJNaMUSCqBeJf25Zr08F9PQE2gHBLTTBeU8=; b=Lp3s5mvN2riCGgxxjcQZJJAXGTnhWsppTPLRc3fr3pKTdwOasX8AnXRLTi2jRP3WVr L4jfNBvgTprxzufomjN5kOLCw7/t4rnTXD7ssl+2VkOpkTap7wj4H6O8TDTQXO7n1onx QUP5Y87gsSRl5wZGrbOBdiezGBYvc8Zl7I17QU3dN3Hm1SK8w0SpjLJfI03fbxR6nQwv cu4guSq+J7E2E9cfqmg3vKI3RJEoTWJwMK+W0o0o7YddlQfgqZWFGgantRQpS5CYT2JO KsLw0s4UFizAWGRHAMVbKsR7PmqPtVcEDVMbnWnFcFD0X9t7L6arIXTq4LYvPNO1b0IU WXSw== X-Gm-Message-State: AGRZ1gITZ5bD7dS3VjBGAP+w48w8EG4xcQ+KBd8ly/00qmFGGz4u9FiW HkhkGLeZEYs6ZnTw0ngGz68= X-Google-Smtp-Source: AJdET5dWGBEI8uJFAzPNw5ymvVcr9w3bKrRmKsG8ju8CEfQ8wwfAdGJQ8O06gUuALuhR+KFPro4Q6g== X-Received: by 2002:a19:c801:: with SMTP id y1mr12950073lff.53.1541445671020; Mon, 05 Nov 2018 11:21:11 -0800 (PST) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id x5-v6sm3591056lfe.58.2018.11.05.11.21.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 11:21:09 -0800 (PST) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, Junio C Hamano , =?utf-8?q?SZEDE?= =?utf-8?q?R_G=C3=A1bor?= Subject: [PATCH v2 04/16] attr.c: mark more string for translation Date: Mon, 5 Nov 2018 20:20:47 +0100 Message-Id: <20181105192059.20303-5-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.1005.gac84295441 In-Reply-To: <20181105192059.20303-1-pclouds@gmail.com> References: <20181028065157.26727-1-pclouds@gmail.com> <20181105192059.20303-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 Mon Nov 5 19:20: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: 10669007 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 124001923 for ; Mon, 5 Nov 2018 19:21:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0315D29C11 for ; Mon, 5 Nov 2018 19:21:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB7A029C73; Mon, 5 Nov 2018 19:21: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 8B34A29C11 for ; Mon, 5 Nov 2018 19:21:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387977AbeKFEmX (ORCPT ); Mon, 5 Nov 2018 23:42:23 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:35406 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387556AbeKFEmX (ORCPT ); Mon, 5 Nov 2018 23:42:23 -0500 Received: by mail-lj1-f193.google.com with SMTP id x85-v6so9145938ljb.2 for ; Mon, 05 Nov 2018 11:21:13 -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=dvg8Z+FQnMXcOmkITbXP+xdOyJ+7C+d3npGAZtsVRp4=; b=gR46Cc/gUu7+d0409H+I8JSSuK8usagjMACnR2/Dp4DHysaRmnWlIkA6ia54Ojk+C9 0ksZoqiozDMbzud+qfJcoLFyCXIO4zIety8xEAevhEo7CKUx4Jm8mn8JVAOAkQzhTzqm NRaq9xwk3tu+DcYVEQhrOVy/kAvO1repP+3r5gye6KPtFVOO2bHGmiCZaIgOpmjVuLsE HpxXeUAzOpKZZKybHCP6WL7c5nJ2zPMIIrqxVCcKv9tRNPomfpjwBxvSARMubg1jlCxA /wKS14rnLxc9ASDkvPqY7YRxs6pnB1M3bZqbOvbHXdn3mBz+FGoxeWC7+2gcsL6wOW25 YSuA== 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=dvg8Z+FQnMXcOmkITbXP+xdOyJ+7C+d3npGAZtsVRp4=; b=KBw7fNoMv9mNkzwbc1gHRx3dcYdl64P9piWAzCvTmQXuquiXJTcZq3Z3v2xnNVriSV OT4c74WxPDbBdH6hXm8Qe1mdBPCSXVfXnuNuXmVGYifLwQN9qWpyQyuVzDKaP/BcjGKq tvApxxnhA6LS9jAP3p8UiGSZJ+0qVffVOHbJMDJ57MgqDNW42DdpaBVYNEt92EXISnmI UbCLW8iKLVp+H7VWr7hfhLaq4zE+WmT/2c7l+t4ZOD9BKEAUfgnpCvO3H3iyQdx08B8w UvqXG6dBF/0yoJr6g7wV2fF45AST8d/E8/Y9t8F5OGoC358YpR6Tg+kPNyHBzZRbkots +ZSw== X-Gm-Message-State: AGRZ1gIyrqRy0zaEYh0duKZIrTa9bgUwRni6q7Go7qiiL3RZ7MVfh6PT xFAykdwdD+54yd0qzSIJ3Z0= X-Google-Smtp-Source: AJdET5cf1BucEI4YYdwXAQV2urS0kZZMI6ue/acDKuQnasv+Zv0GEnAEZFRadtKWXMhvpNNsvu+HjA== X-Received: by 2002:a2e:9d50:: with SMTP id y16-v6mr16483902ljj.136.1541445672183; Mon, 05 Nov 2018 11:21:12 -0800 (PST) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id x5-v6sm3591056lfe.58.2018.11.05.11.21.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 11:21:11 -0800 (PST) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, Junio C Hamano , =?utf-8?q?SZEDE?= =?utf-8?q?R_G=C3=A1bor?= Subject: [PATCH v2 05/16] read-cache.c: turn die("internal error") to BUG() Date: Mon, 5 Nov 2018 20:20:48 +0100 Message-Id: <20181105192059.20303-6-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.1005.gac84295441 In-Reply-To: <20181105192059.20303-1-pclouds@gmail.com> References: <20181028065157.26727-1-pclouds@gmail.com> <20181105192059.20303-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 Mon Nov 5 19:20: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: 10669015 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 6D2AA417B for ; Mon, 5 Nov 2018 19:21:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E5DD29BE4 for ; Mon, 5 Nov 2018 19:21:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52E8E29C74; Mon, 5 Nov 2018 19:21:19 +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 62BD629BE4 for ; Mon, 5 Nov 2018 19:21:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387983AbeKFEmZ (ORCPT ); Mon, 5 Nov 2018 23:42:25 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:33875 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387962AbeKFEmY (ORCPT ); Mon, 5 Nov 2018 23:42:24 -0500 Received: by mail-lj1-f194.google.com with SMTP id u6-v6so9161066ljd.1 for ; Mon, 05 Nov 2018 11:21:14 -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=G+Nek8bHEs/aURWlpIkOGWZN9CRGpbaRdFIg4gA2GUk=; b=OQt1waf6BjYptp/bNpngwAMD0m0rNRgFIUKDmCd3Ax60WHObYSzGcx3FPm0OR5ONYu f1nS2/Mi0GTEfacGA+VNNbt/vThi362GCoVN3mB84QKZHHs3yR422MUeupHGyCoETOKQ LMh4Mb9SSMU3W1Mo1kFIGlgbIqFjanlnz5ckUsufdg39jUmbvjS9OC8I+WxgZrO10y+9 ZwHEXMEDL8Y7ZTMi2eXo0BNsySVaQ0ApQp4MQai/0TlXlF3GUv3VC5EDqnZsTY/x3KWY bTiuxsXWIGDYBatpLv1NGeFB8kOF/OCeDNv8AKj//2rMoHs0HhWGyBJU7ZqHeJbUe9Wv vnuw== 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=G+Nek8bHEs/aURWlpIkOGWZN9CRGpbaRdFIg4gA2GUk=; b=s5drDcTWZkjeRIFQ6EQz/BjQjllX8difczNbwpqf1Cu/A8FxFhussraObCYYK3QIRU l0/cQ6TWyEkMThM14R32bHBBuGSdT/MPbjKpKWaAcGPGBmolzVNT8INj0vXVReDWu39B 6af56qOAPf7G8klSln+SB9TkM7JdRTCTbr0al0+TtrPvWWmenOEPsM2mXY9iuyVJyvhT 0UErUux3Wd17DqpFPw7HjUAE793HrZkHQPZkKAfG/Qf0tEELtk8lRAcf2W2+dqXOJ/D0 UTxnISj00i4X9QLp7tV+L6e+M2dP/7QVVq0UtnPr30aluhwEYjk/+3MPISNxO0OjbREw xOeQ== X-Gm-Message-State: AGRZ1gJ71pPvGkWMW2mqgjDls2J/IWS/LkD01jhC/B8FYR31wxiBt7RY 5z9cO3TGMS+Khi68k4Bx+wM= X-Google-Smtp-Source: AJdET5ebHny1zNOBcVm5N7wQ9ge2Asho/x4Wq3vGlb7y3xwGYUbWGZi3e43eQ94Vbb1beJU6Z6It2g== X-Received: by 2002:a2e:50d:: with SMTP id 13-v6mr14967343ljf.85.1541445673214; Mon, 05 Nov 2018 11:21:13 -0800 (PST) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id x5-v6sm3591056lfe.58.2018.11.05.11.21.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 11:21:12 -0800 (PST) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, Junio C Hamano , =?utf-8?q?SZEDE?= =?utf-8?q?R_G=C3=A1bor?= Subject: [PATCH v2 06/16] read-cache.c: mark more strings for translation Date: Mon, 5 Nov 2018 20:20:49 +0100 Message-Id: <20181105192059.20303-7-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.1005.gac84295441 In-Reply-To: <20181105192059.20303-1-pclouds@gmail.com> References: <20181028065157.26727-1-pclouds@gmail.com> <20181105192059.20303-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 Mon Nov 5 19:20: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: 10669009 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 2CAE018FD for ; Mon, 5 Nov 2018 19:21:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D116929C74 for ; Mon, 5 Nov 2018 19:21:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C508929C91; Mon, 5 Nov 2018 19:21:20 +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 7975C29C83 for ; Mon, 5 Nov 2018 19:21:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388015AbeKFEm1 (ORCPT ); Mon, 5 Nov 2018 23:42:27 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:38220 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387556AbeKFEm0 (ORCPT ); Mon, 5 Nov 2018 23:42:26 -0500 Received: by mail-lf1-f67.google.com with SMTP id p86so7023195lfg.5 for ; Mon, 05 Nov 2018 11:21:16 -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=RoAfIjfV6rZiew1hUmarcExoqd/S8h47l+w/BWFL8D4=; b=TstDATQpYSVCxm7eYggyiy3Jm4LwgXXoBNv2LYhrH5UheAqRs4oxCbUWQPjpqVEB8m rVd9hte3Gr95omHOXC/uz0WsQpyDPvbkHIh/WZ+zcucztS6mnST5z9oKyB1a+Lm9Y+L8 g/CwagzoV+vdeFabnuRqsh1Nf0ShrIHaKLdtnngzRWVkZ6Xp1N6Kowe6iabvzy/9qppW 2yR6Pg/Lw4rnM2ZYLZEVoyKRSthNkWV7xjtjvY6DOUzC6TKupNHX+C74cRvA2eUSSgWx 3iv3tSskr8GKECWEFTVcp/h6i5SiFG5YqXlODvbY2jvGebBplWynAWaNNRdQYMWuFjYq oNEg== 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=RoAfIjfV6rZiew1hUmarcExoqd/S8h47l+w/BWFL8D4=; b=GgB/Nt+JWZHmFwDlaaTOaKRC8TmDt4RyxxVM6Mfe9GBonS29odEiINWp6BWEaBDmfM 5Vjqx52AnCp5Cck+rfObBns5BIXQQjtJ3qSiW+Gjo0QpBeYYZJNG11ttxHuRi6Bdyspl xKSYILm7WDpUZ0KOjpf9oC1YBwzkJ9R7Y6XkNfrPVrNWGyGqmHWRsXrz7L91dd8FEQM7 rfYTBmvdlD8GWcJM1lWbkwuaJVqbzlW6Mu6zNsdt8j6CgFFSIol7PKNC+M8fG7KRNevR 6UKnwe2Ean2SkqZqaJcCqGVNQmEOXOw3rH6WTe6aWP4zCTqcNSdTwhqBSc/YYcl2IHsw E23A== X-Gm-Message-State: AGRZ1gIj4nK8W8fERC+L/uj6tuOUBnW9TBwN4hf+7VWITUBEJLc1xZJQ XB6104voBVmzqA3nmgb8GvBepwcQ X-Google-Smtp-Source: AJdET5dsFijBjQpIhnjhvHDbkmr4FBWagU/wKDkD7fYZHjdEf/2PHYQcZtRf+fzOEAfk1cgDEaCfhA== X-Received: by 2002:a19:c7c2:: with SMTP id x185mr14005043lff.123.1541445676113; Mon, 05 Nov 2018 11:21:16 -0800 (PST) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id x5-v6sm3591056lfe.58.2018.11.05.11.21.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 11:21:15 -0800 (PST) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, Junio C Hamano , =?utf-8?q?SZEDE?= =?utf-8?q?R_G=C3=A1bor?= Subject: [PATCH v2 07/16] read-cache.c: add missing colon separators Date: Mon, 5 Nov 2018 20:20:50 +0100 Message-Id: <20181105192059.20303-8-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.1005.gac84295441 In-Reply-To: <20181105192059.20303-1-pclouds@gmail.com> References: <20181028065157.26727-1-pclouds@gmail.com> <20181105192059.20303-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 Mon Nov 5 19:20: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: 10669013 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 4560815A6 for ; Mon, 5 Nov 2018 19:21:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38A5D29C9B for ; Mon, 5 Nov 2018 19:21:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D51929CD1; Mon, 5 Nov 2018 19:21:23 +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 A98A629CB5 for ; Mon, 5 Nov 2018 19:21:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388018AbeKFEm2 (ORCPT ); Mon, 5 Nov 2018 23:42:28 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:35409 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387962AbeKFEm1 (ORCPT ); Mon, 5 Nov 2018 23:42:27 -0500 Received: by mail-lj1-f193.google.com with SMTP id x85-v6so9146113ljb.2 for ; Mon, 05 Nov 2018 11:21:17 -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=e7yB6NC6mYec9WbpnahjiDZzCEhKwkHF2g4POrI8edQ=; b=SYx7I/eiUkO+9Hulvx4Dtr2ZQkdq6Nwa3qotmdg5AJVN2iWBEERuyIpM03VANSIjIA RJ01l54/zi/QnrxS/4+aZJhcuRWeoUV/ZW9H9YYOphjBoep5uhNQL0l1ApkTEzS65G9p ukiFTUS7d4mFoZWmLW6E32zZxlYqMFyyZLYCVsnuxNDqxWEawvNeUQJs+qK2ZTZ7urqa ImCTpIMWyvhGJWrPezuouQ35Rt+TP9ZjBxkL63WBuK+0oCgLpKtAofbMhiwWLZLB4bDV 0jZhnFv24o9qbx0QFyubkuHxJxqRxIj7osxqq8V5HjHevYavTSNepZV1RS28DLBJCjZy OOkQ== 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=e7yB6NC6mYec9WbpnahjiDZzCEhKwkHF2g4POrI8edQ=; b=J6DM7WwPu2AdIKsQNM2sFKOVT8LkWhq1hdf1K09YwfLLtvtKK+m9stBNihB4TRr4UI OjvrCWZdUsJ58alVBBfzhTrYJ6omOAO4/BqOBuoU+CDTNE6N4aCnTp7dx9xesyNOSCn2 Q7bY7C9DVdLFhk+YyeNSsNITxvGxDK0BzxFBEHcw3vc/WhuzbmtOZJYUXKq1G/VvotVP NyYUI80QWKlTCYugI0/g2a+PBRSq62Z5qAalFmr5vF1VS9pxdn32qH3a11LmdO6b1JUR PUWsG+vK1ig2g7z2XZBhMUqrKLDMYGzbs8algv5rnxEVe+vLAMHwLpSODU7BQGM3+hDL gV9w== X-Gm-Message-State: AGRZ1gIPEBs92GvoIg8o+e2Oc/CHl77dqS4SSmYJU7gNQf4MDy5AnInK dOR2/cCc0CAf4YSONUsnXrz6Emcx X-Google-Smtp-Source: AJdET5cE4+c/Hl67z5dfGnztYh5rQkrAj67npYdwmDamB3/aa5sHXRhkTpqz3JHV5KUBjYPaaR873g== X-Received: by 2002:a2e:2166:: with SMTP id h99-v6mr4050204ljh.53.1541445677108; Mon, 05 Nov 2018 11:21:17 -0800 (PST) Received: from localhost.localdomain (c80-216-12-205.bredband.comhem.se. [80.216.12.205]) by smtp.gmail.com with ESMTPSA id x5-v6sm3591056lfe.58.2018.11.05.11.21.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 11:21:16 -0800 (PST) From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, Junio C Hamano , =?utf-8?q?SZEDE?= =?utf-8?q?R_G=C3=A1bor?= Subject: [PATCH v2 08/16] reflog: mark strings for translation Date: Mon, 5 Nov 2018 20:20:51 +0100 Message-Id: <20181105192059.20303-9-pclouds@gmail.com> X-Mailer: git-send-email 2.19.1.1005.gac84295441 In-Reply-To: <20181105192059.20303-1-pclouds@gmail.com> References: <20181028065157.26727-1-pclouds@gmail.com> <20181105192059.20303-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=