From patchwork Thu Jan 17 13:05:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10768135 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 E50F96C2 for ; Thu, 17 Jan 2019 13:10:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0C122F98D for ; Thu, 17 Jan 2019 13:10:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CEF462FA05; Thu, 17 Jan 2019 13:10:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B1EC2F98D for ; Thu, 17 Jan 2019 13:10:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728151AbfAQNKQ (ORCPT ); Thu, 17 Jan 2019 08:10:16 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:35527 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726065AbfAQNKQ (ORCPT ); Thu, 17 Jan 2019 08:10:16 -0500 Received: by mail-pg1-f193.google.com with SMTP id s198so4449117pgs.2 for ; Thu, 17 Jan 2019 05:10:15 -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=LDT8gtZcl1PyfGl774NPDcRkCy5xCE0ydeyHO478720=; b=gZgL28RwBaZVls8AiwTSC2+WNsreOfnli4yJKfgpsB2fmlxMlZgfjJam/niPZydKia Liw+GJ5y/sf+TPZyEiTVullaUvKozW10pviT9Rocb/edN/wTRGRIFRNlbTkGLI761tUW qN2vAAa7TUm4VsCnd81zB85LTohXazNsIYV6IWtqaPo3wXNKK0t+n8fZGcos6Q4DxDrA PVDRnVf8W1szxUfx6n+jWfwZIJ4fmjEKUfAoHbEDdKtnIy6zGhonglVKnThIF9r0Bj/G ismtLvKbmT+pZQUGfJ89nWyHOFSDiE40QIhQRn8qTZhzQDOkLeEDXmJgwmT4mF+jrtt/ xWBg== 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=LDT8gtZcl1PyfGl774NPDcRkCy5xCE0ydeyHO478720=; b=m884TLyo597oniJlYyI+sLNRaH85p9xlhcgbwxPnM9c04LWAXmPeCDXvwIwEa6WDII ICsDM+JzXBz2BvKJvdQHjRZlc4OQgqgFWHCFGvxLuoCQVkV4hf+oqGmM2dDUwbUMahU7 gNaioq6ky7jsparTmtElHNWDs6IGkkp1sMCB3PwmthzQox9AqA4JWjFYm6aPBbgi8HZs w/umWCR6+twzsMjvJe/hY5CjqX+vXrLTyefCF1NXfOh378CTiGpJHFP23ybyspgNFmzH h5Qbmndt6VmyK5hM/p5QAXAGF0CMUXj+0vXCu62hDqWcV50OCwVOcmBDZCyhKsICWHkt uroA== X-Gm-Message-State: AJcUukfHltUDyC4ZNBivNJ3w8oje5TZlc1a2Lywoyw1tKKNx1fa5aIph a3qAIbE/Pg/q1J8yz3po8Di9fCnB X-Google-Smtp-Source: ALg8bN7X2iDoc6pLJv2t3+tVxWyU3DlgPTVvxLj9jJHMcUjn9ShfyW8bJiqsB5KZCuVwUpF99bOBTQ== X-Received: by 2002:a62:9fcf:: with SMTP id v76mr9334047pfk.144.1547730615242; Thu, 17 Jan 2019 05:10:15 -0800 (PST) Received: from ash ([115.72.21.220]) by smtp.gmail.com with ESMTPSA id r66sm3918420pfk.157.2019.01.17.05.10.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Jan 2019 05:10:14 -0800 (PST) Received: by ash (sSMTP sendmail emulation); Thu, 17 Jan 2019 20:10:10 +0700 From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: git@vger.kernel.org Cc: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= Subject: [PATCH 45/76] diff.c: convert -R Date: Thu, 17 Jan 2019 20:05:44 +0700 Message-Id: <20190117130615.18732-46-pclouds@gmail.com> X-Mailer: git-send-email 2.20.0.482.g66447595a7 In-Reply-To: <20190117130615.18732-1-pclouds@gmail.com> References: <20190117130615.18732-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 --- diff.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/diff.c b/diff.c index d342d06399..13de6ea35c 100644 --- a/diff.c +++ b/diff.c @@ -5220,6 +5220,8 @@ static void prep_parse_options(struct diff_options *options) diff_opt_relative), OPT_BOOL('a', "text", &options->flags.text, N_("treat all files as text")), + OPT_BOOL('R', NULL, &options->flags.reverse_diff, + N_("swap two inputs, reverse the diff")), { OPTION_CALLBACK, 0, "output", options, N_(""), N_("Output to a specific file"), PARSE_OPT_NONEG, NULL, 0, diff_opt_output }, @@ -5252,9 +5254,7 @@ int diff_opt_parse(struct diff_options *options, return ac; /* flags options */ - if (!strcmp(arg, "-R")) - options->flags.reverse_diff = 1; - else if (!strcmp(arg, "--follow")) + if (!strcmp(arg, "--follow")) options->flags.follow_renames = 1; else if (!strcmp(arg, "--no-follow")) { options->flags.follow_renames = 0;