From patchwork Sat Feb 16 11:33:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10816173 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 DF21513B4 for ; Sat, 16 Feb 2019 11:34:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD57528722 for ; Sat, 16 Feb 2019 11:34:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0E452873B; Sat, 16 Feb 2019 11:34: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 6282628722 for ; Sat, 16 Feb 2019 11:34:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727393AbfBPLeP (ORCPT ); Sat, 16 Feb 2019 06:34:15 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:40982 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbfBPLeO (ORCPT ); Sat, 16 Feb 2019 06:34:14 -0500 Received: by mail-pl1-f196.google.com with SMTP id y5so724328plk.8 for ; Sat, 16 Feb 2019 03:34: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=1L6nnZ0CQOEd8nqEx0K4c9mVLDHGNdTtVO2eemjkX9A=; b=uFdX/XR0eHYLTg+2tnebvRBvB237CtxDqJtzodBGb/sp9x8red04uTNN56bkcQLyXx tFbmx7ZxBuCfcfxvXfVbpCqhlkioN1ixHXe/3bODyk0nacXKYclaTQPpZjnxziQIJfqY evu8L1p+CIioKExWBvlbFZU6f33DEwh8UnR3mZTZL6e3B/0ZOXw37qZ4mW7q2Tfc33TE ttFC+erqYH6cENH3/1bcdkashT2rzU34rH4TmZTnhE3hgDKbAegx6yXSNhINb+FH7ep5 LEiQAfEk6a5cj5D1Sz+0IFitS/mVc+l0nRxvLNnjeey/NU/W/BVFgOMkBNrSB/POZ2Fa oDfg== 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=1L6nnZ0CQOEd8nqEx0K4c9mVLDHGNdTtVO2eemjkX9A=; b=g8FgBBZoknk3sRQOr7AXGE9FcJA6GexiDQ9er/ZeqmikC03fmgmx89f/uxC0MHawmi ale3Nr6nxPlfPUuL7CCwzUQbwR7XL10pvxhEptXrLRTDHtq4rd4x0LWRurYYFSjwUk2y mErimcqxtMyXop2x1VvvYC3mjDXor2DDTD3wyZ9Y7qRlt12fw/pfUkGZFwKIrWJ9laM2 0NVrrlkvYCGy91hoPVPAt6GWuyH6Y3NLHPG9rYyt5SbIodZMb7nRSnDFDbTjADOs/Jb2 uhPQz6B7exM517sZYTuEV9dCNDQ3oFG+fFQCppgejNo282qlTHiaRw5WYfcqFB1ipIAD lXug== X-Gm-Message-State: AHQUAubU6rbR08ZGxz64Qh2GFgJXhNmjnXrJ39pzT/Dsu1RfJD9OZDsl 4xQJICOPCaX3vrSR5aEclzQ= X-Google-Smtp-Source: AHgI3IZs5zPkqZjaypHVxH1xR1MV4Tvd/nKZIR0dPuMRY+aGlN3+kC7IB5O11jdhON3gbnAd0y1bSw== X-Received: by 2002:a17:902:930b:: with SMTP id bc11mr15262283plb.101.1550316854127; Sat, 16 Feb 2019 03:34:14 -0800 (PST) Received: from ash ([115.72.21.220]) by smtp.gmail.com with ESMTPSA id q28sm23233865pgl.35.2019.02.16.03.34.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Feb 2019 03:34:13 -0800 (PST) Received: by ash (sSMTP sendmail emulation); Sat, 16 Feb 2019 18:34:09 +0700 From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, gitster@pobox.com, =?utf-8?q?SZEDER_G=C3=A1bor?= Subject: [PATCH v2 01/21] diff-parseopt: convert --patch-with-raw Date: Sat, 16 Feb 2019 18:33:26 +0700 Message-Id: <20190216113346.25000-2-pclouds@gmail.com> X-Mailer: git-send-email 2.21.0.rc0.328.g0e39304f8d In-Reply-To: <20190216113346.25000-1-pclouds@gmail.com> References: <20190207103326.10693-1-pclouds@gmail.com> <20190216113346.25000-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 Signed-off-by: Junio C Hamano --- diff.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/diff.c b/diff.c index 4bc9df7362..12e333c67f 100644 --- a/diff.c +++ b/diff.c @@ -4901,6 +4901,10 @@ static void prep_parse_options(struct diff_options *options) OPT_BIT_F(0, "raw", &options->output_format, N_("generate the diff in raw format"), DIFF_FORMAT_RAW, PARSE_OPT_NONEG), + OPT_BITOP(0, "patch-with-raw", &options->output_format, + N_("synonym for '-p --raw'"), + DIFF_FORMAT_PATCH | DIFF_FORMAT_RAW, + DIFF_FORMAT_NO_OUTPUT), OPT_END() }; @@ -4929,10 +4933,7 @@ int diff_opt_parse(struct diff_options *options, return ac; /* Output format options */ - if (!strcmp(arg, "--patch-with-raw")) { - enable_patch_output(&options->output_format); - options->output_format |= DIFF_FORMAT_RAW; - } else if (!strcmp(arg, "--numstat")) + if (!strcmp(arg, "--numstat")) options->output_format |= DIFF_FORMAT_NUMSTAT; else if (!strcmp(arg, "--shortstat")) options->output_format |= DIFF_FORMAT_SHORTSTAT; From patchwork Sat Feb 16 11:33:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10816175 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 2F0E8922 for ; Sat, 16 Feb 2019 11:34:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C00628D3E for ; Sat, 16 Feb 2019 11:34:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AC632BE4F; Sat, 16 Feb 2019 11:34:22 +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 A353128D3E for ; Sat, 16 Feb 2019 11:34:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727588AbfBPLeU (ORCPT ); Sat, 16 Feb 2019 06:34:20 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:42787 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbfBPLeT (ORCPT ); Sat, 16 Feb 2019 06:34:19 -0500 Received: by mail-pg1-f195.google.com with SMTP id b2so346563pgl.9 for ; Sat, 16 Feb 2019 03:34:19 -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=EI6iADq4mEfiqdHjsFNg+D7GzxgJW4c3B/6yv7BN4jg=; b=UkJo580p/caoTDPqiaB11mcLbljWaPZ1hVQQaJBdcgSOV7uUQObGal+8O/mStnjMPf jbIj6Sq/YUlbIzJfEMW67Ol8PwU3qW4LxOw5kZM2gcx7TPPoQsuVz0+7vY21INtia9Ks YAztCR/QTCoPKgGiyxhEFkeusemXNfkVpRgtHvf5a3pEt4a557koEj+3yhofNQ/3XB8w e+R1MK+GDTRN4/hkhQ0QQKDIYNZ7xdslaqMTQvCPSACqzGaroANVZYRb2mvMP5XM3aqR Cly2hsA1Ks4YDU/0bV7K9rXZqSXx+IqbkvbjERTIGoFXXchLZtCAcOjTUxw0WpKaQhBU 6f3w== 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=EI6iADq4mEfiqdHjsFNg+D7GzxgJW4c3B/6yv7BN4jg=; b=HvZofbS0fYkkbUyMXGOY54OUEliaQUbR6mHObdCkJwVX860ziw0z84JTRVk372oL6A tv0db/0ICXuM0cV5O62+g2P+dNCbDq4Swbd8XLj2xvr9exnYJIY0CVTYK0e2RqZXYPg0 mI7ktHWKe1aqZ+5zUZLHH9z5fNm/92B/RBhRdEYWvJ5XEaklsrTCjUywC1W0MiVv0Ypu Xia6/8JaJpCev3ZnLrQL60fyQpMVl3qHO/eKXtAQVWadrocWvOyVkSkeOnwTFH+iZgr7 //BRIB7dyTlGoCM0mzByGeOH+MV0FYoncWY1epTqGo26vDNnBVwID2Nf5y+InsuqZuZx wu1A== X-Gm-Message-State: AHQUAuao80114hxHjOK/7vHxLLgSA6XaO+rBzMNfxKNlGGz3i/iJtyqL /WqRv/+aAgGl64mX20w96M8= X-Google-Smtp-Source: AHgI3IbXr3liIJM5nFbFuXCQYa8VzHyhUTvcB18dIBTwfKl2JNdGr8V7ylIv8J4M5h6+FrBjVcRdnA== X-Received: by 2002:a63:db02:: with SMTP id e2mr9900875pgg.419.1550316858736; Sat, 16 Feb 2019 03:34:18 -0800 (PST) Received: from ash ([115.72.21.220]) by smtp.gmail.com with ESMTPSA id d13sm13100658pfd.58.2019.02.16.03.34.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Feb 2019 03:34:18 -0800 (PST) Received: by ash (sSMTP sendmail emulation); Sat, 16 Feb 2019 18:34:14 +0700 From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, gitster@pobox.com, =?utf-8?q?SZEDER_G=C3=A1bor?= Subject: [PATCH v2 02/21] diff-parseopt: convert --numstat and --shortstat Date: Sat, 16 Feb 2019 18:33:27 +0700 Message-Id: <20190216113346.25000-3-pclouds@gmail.com> X-Mailer: git-send-email 2.21.0.rc0.328.g0e39304f8d In-Reply-To: <20190216113346.25000-1-pclouds@gmail.com> References: <20190207103326.10693-1-pclouds@gmail.com> <20190216113346.25000-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 Signed-off-by: Junio C Hamano --- diff.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/diff.c b/diff.c index 12e333c67f..419b6ac4ae 100644 --- a/diff.c +++ b/diff.c @@ -4905,6 +4905,12 @@ static void prep_parse_options(struct diff_options *options) N_("synonym for '-p --raw'"), DIFF_FORMAT_PATCH | DIFF_FORMAT_RAW, DIFF_FORMAT_NO_OUTPUT), + OPT_BIT_F(0, "numstat", &options->output_format, + N_("machine friendly --stat"), + DIFF_FORMAT_NUMSTAT, PARSE_OPT_NONEG), + OPT_BIT_F(0, "shortstat", &options->output_format, + N_("output only the last line of --stat"), + DIFF_FORMAT_SHORTSTAT, PARSE_OPT_NONEG), OPT_END() }; @@ -4933,11 +4939,7 @@ int diff_opt_parse(struct diff_options *options, return ac; /* Output format options */ - if (!strcmp(arg, "--numstat")) - options->output_format |= DIFF_FORMAT_NUMSTAT; - else if (!strcmp(arg, "--shortstat")) - options->output_format |= DIFF_FORMAT_SHORTSTAT; - else if (skip_prefix(arg, "-X", &arg) || + if (skip_prefix(arg, "-X", &arg) || skip_to_optional_arg(arg, "--dirstat", &arg)) return parse_dirstat_opt(options, arg); else if (!strcmp(arg, "--cumulative")) From patchwork Sat Feb 16 11:33:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10816177 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 DC9B2922 for ; Sat, 16 Feb 2019 11:34:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC86628D3E for ; Sat, 16 Feb 2019 11:34:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0F432CD46; Sat, 16 Feb 2019 11:34:26 +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 4BBBA2A96B for ; Sat, 16 Feb 2019 11:34:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727657AbfBPLeZ (ORCPT ); Sat, 16 Feb 2019 06:34:25 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:38746 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbfBPLeY (ORCPT ); Sat, 16 Feb 2019 06:34:24 -0500 Received: by mail-pg1-f195.google.com with SMTP id m2so3818213pgl.5 for ; Sat, 16 Feb 2019 03:34:24 -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=JnyrUaL/kZL6vPDg/HP2kg0btx0wRK4SlqgkVv2Eras=; b=mL50JMnUsgs8F0USj8mEyqT16/Rn76WMXkBhoLrJ+hrrwPhgJDeQBMFLM1AEdvskgF 3KvWBQPGLfpcvbhrMv3qKsNqGBSZ1NPaDR2MYTOhEPcxIYP8QxKiqKEoOZG8EQa27xz9 0uJsJV9Uf7FzqjVfqWSavk0ntr7ALU4bGJU4YINgI0nkXzIgLiOBg7X49sAkcM0qNanP Zm8Wz3LQPH73slSxIHXBBmD9hNKdjoFqUDWKTV8vhU4jJgrmHLjGt83qK5dZYIVmNHZ/ etmQ26YfrBQ8sy8xpeuwJo/6TXQOKdb6StLg/uvQq/cJAN47GVfqkF1OuYMshFBL08nT 6yFA== 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=JnyrUaL/kZL6vPDg/HP2kg0btx0wRK4SlqgkVv2Eras=; b=PqpnAwoVR9suPOBCs2gz2Leax5TBE/rfb3+MFidfexHncvlA2t3B4L2eNtA2RYkjrT 2tgaKhtc6IG07/yX2lM1LIk3krc3HAG9U/ZLW/+5hfzbSJ1VDWxF7c6BdtHpfE5mIu+F jIyxE1yXu5HVgK8yv9mQSogXNZrNQo1K0hCZcAEpwxl+D2Q3U4SX6y3YL9lzXwp/K4Fa 6E6cTIhxhvNciQk73mGfxC3SrG2Ms9xefNPljN/IkZoxyeErf9hD0c+0KnySU4a1c+/I DLyU4GzUgH5uj3uKbtCK4/gqSvvUVg+DfAlC7Tu4D0qV3Te0e9kzYq6Zqm/KgM6qT0Kf Dmsw== X-Gm-Message-State: AHQUAuZFH9vvZCT8ZVAhKkcoI/1oFj/Icj5Afw3470wBfBnWrubkmXdf Yxg6AE94v6PJr19sEZJrRR+hz8QN X-Google-Smtp-Source: AHgI3IbE9ZJ4ivTw6H2wD8lAlVyhV3vfzBOq9gsfDTdnhAk7s5d7BSnq6q90qMHD/Y0HBmWoXKrOoA== X-Received: by 2002:a63:c204:: with SMTP id b4mr9699905pgd.335.1550316863794; Sat, 16 Feb 2019 03:34:23 -0800 (PST) Received: from ash ([115.72.21.220]) by smtp.gmail.com with ESMTPSA id x3sm13593952pgc.80.2019.02.16.03.34.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Feb 2019 03:34:22 -0800 (PST) Received: by ash (sSMTP sendmail emulation); Sat, 16 Feb 2019 18:34:18 +0700 From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, gitster@pobox.com, =?utf-8?q?SZEDER_G=C3=A1bor?= Subject: [PATCH v2 03/21] diff-parseopt: convert --dirstat and friends Date: Sat, 16 Feb 2019 18:33:28 +0700 Message-Id: <20190216113346.25000-4-pclouds@gmail.com> X-Mailer: git-send-email 2.21.0.rc0.328.g0e39304f8d In-Reply-To: <20190216113346.25000-1-pclouds@gmail.com> References: <20190207103326.10693-1-pclouds@gmail.com> <20190216113346.25000-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 Signed-off-by: Junio C Hamano --- Documentation/diff-options.txt | 7 ++++++ diff.c | 39 +++++++++++++++++++++++++--------- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 0711734b12..058d93ec4f 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -148,6 +148,7 @@ These parameters can also be set individually with `--stat-width=`, number of modified files, as well as number of added and deleted lines. +-X:: --dirstat[=]:: Output the distribution of relative amount of changes for each sub-directory. The behavior of `--dirstat` can be customized by @@ -192,6 +193,12 @@ directories with less than 10% of the total amount of changed files, and accumulating child directory counts in the parent directories: `--dirstat=files,10,cumulative`. +--cumulative:: + Synonym for --dirstat=cumulative + +--dirstat-by-file[=...]:: + Synonym for --dirstat=files,param1,param2... + --summary:: Output a condensed summary of extended header information such as creations, renames and mode changes. diff --git a/diff.c b/diff.c index 419b6ac4ae..1cdbe8e688 100644 --- a/diff.c +++ b/diff.c @@ -4867,6 +4867,22 @@ static int parse_objfind_opt(struct diff_options *opt, const char *arg) return 1; } +static int diff_opt_dirstat(const struct option *opt, + const char *arg, int unset) +{ + struct diff_options *options = opt->value; + + BUG_ON_OPT_NEG(unset); + if (!strcmp(opt->long_name, "cumulative")) { + if (arg) + BUG("how come --cumulative take a value?"); + arg = "cumulative"; + } else if (!strcmp(opt->long_name, "dirstat-by-file")) + parse_dirstat_opt(options, "files"); + parse_dirstat_opt(options, arg ? arg : ""); + return 0; +} + static int diff_opt_unified(const struct option *opt, const char *arg, int unset) { @@ -4911,6 +4927,18 @@ static void prep_parse_options(struct diff_options *options) OPT_BIT_F(0, "shortstat", &options->output_format, N_("output only the last line of --stat"), DIFF_FORMAT_SHORTSTAT, PARSE_OPT_NONEG), + OPT_CALLBACK_F('X', "dirstat", options, N_("..."), + N_("output the distribution of relative amount of changes for each sub-directory"), + PARSE_OPT_NONEG | PARSE_OPT_OPTARG, + diff_opt_dirstat), + OPT_CALLBACK_F(0, "cumulative", options, NULL, + N_("synonym for --dirstat=cumulative"), + PARSE_OPT_NONEG | PARSE_OPT_NOARG, + diff_opt_dirstat), + OPT_CALLBACK_F(0, "dirstat-by-file", options, N_("..."), + N_("synonym for --dirstat=files,param1,param2..."), + PARSE_OPT_NONEG | PARSE_OPT_OPTARG, + diff_opt_dirstat), OPT_END() }; @@ -4939,16 +4967,7 @@ int diff_opt_parse(struct diff_options *options, return ac; /* Output format options */ - if (skip_prefix(arg, "-X", &arg) || - skip_to_optional_arg(arg, "--dirstat", &arg)) - return parse_dirstat_opt(options, arg); - else if (!strcmp(arg, "--cumulative")) - return parse_dirstat_opt(options, "cumulative"); - else if (skip_to_optional_arg(arg, "--dirstat-by-file", &arg)) { - parse_dirstat_opt(options, "files"); - return parse_dirstat_opt(options, arg); - } - else if (!strcmp(arg, "--check")) + if (!strcmp(arg, "--check")) options->output_format |= DIFF_FORMAT_CHECKDIFF; else if (!strcmp(arg, "--summary")) options->output_format |= DIFF_FORMAT_SUMMARY; From patchwork Sat Feb 16 11:33:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10816179 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 CA09F17D5 for ; Sat, 16 Feb 2019 11:34:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA42828D3E for ; Sat, 16 Feb 2019 11:34:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE1E42CD46; Sat, 16 Feb 2019 11:34:30 +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 5A89528D3E for ; Sat, 16 Feb 2019 11:34:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727672AbfBPLe3 (ORCPT ); Sat, 16 Feb 2019 06:34:29 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:42797 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727658AbfBPLe3 (ORCPT ); Sat, 16 Feb 2019 06:34:29 -0500 Received: by mail-pg1-f196.google.com with SMTP id b2so346649pgl.9 for ; Sat, 16 Feb 2019 03:34:28 -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=w2j+39L0SZuLz7tH9WBUwitNrZeJ9smd07RyrGJd1u8=; b=qahrJK4NX3wrh2t2QEqV4NZO+/1+jJ64SeOon258LgtqHwggXTR9ju9fTh71MMjRha UBQN22hlFbEv2Xz5RYnFj2plsp260UQbAeoL/XjzFB7RXw/71XfEsi3au7yardvLertp viEZymir8Sta7yFkOJ8OepGa5Ui/+cZi/Dx+u9EQ7u1fDLX4Vs3p4jS1G/NqFODer0Op K+uH1njaFn2/z8IaNDSb+OGMCDNV+sJryFSexUbhpNKImELotQ/OU+mnhTxWBeuAqpis tj/zP52APVcs42/HxMJy4o70cxUuuVI0xuiYf15xH+zDBVU4q5/JdoBGg4QBbLNevjJ7 UelA== 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=w2j+39L0SZuLz7tH9WBUwitNrZeJ9smd07RyrGJd1u8=; b=cCzkftht5/QAW7ft0zD/+EUB6MuLDvAxeAF9HaICBfdxHjXmFSPpEwLlXqzPeWD+CC +qG++8pr8Lwln1xRfp36JIppjoTdDeSO9fKSnr7EbRI+/bTnfF7oWpy+Kb3t5xSfF8yB 4bwS3O1faPqBTQXF2EGYyZs43ajq0aLITBP3IqvOLtU6KvazKcVOKRVs7TTLKUsxtDHQ 18FDp430hzWkjSXlJ0mbPh5KRaCulXmfTqfPTshyHF/HOWM+spSQkX8MmrXoRm4mr6Np tsU+jf6WHJl5ia1JbgKZtSHvrQYxHYcs4CsCIyYh7tIr21c3ZXcmlzc6oStcFTXYle0e T6XA== X-Gm-Message-State: AHQUAuYQR2TB61H4Lc1PJ3z6PyKX1ZRHfQW6V8IJW4UI976rBnfB3ft/ SmV5Esl1/H5zNEhHtxuVXAuaF8Br X-Google-Smtp-Source: AHgI3IaovhQ1MxPJSI0Q/HEZLuRkyqbF+NLxzlcTfX2NzoikhfK6mfCZ4JX1qZ1e2/57kXUeUdgrrg== X-Received: by 2002:a65:620a:: with SMTP id d10mr9529164pgv.75.1550316868461; Sat, 16 Feb 2019 03:34:28 -0800 (PST) Received: from ash ([115.72.21.220]) by smtp.gmail.com with ESMTPSA id 4sm7914389pft.96.2019.02.16.03.34.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Feb 2019 03:34:27 -0800 (PST) Received: by ash (sSMTP sendmail emulation); Sat, 16 Feb 2019 18:34:24 +0700 From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, gitster@pobox.com, =?utf-8?q?SZEDER_G=C3=A1bor?= Subject: [PATCH v2 04/21] diff-parseopt: convert --check Date: Sat, 16 Feb 2019 18:33:29 +0700 Message-Id: <20190216113346.25000-5-pclouds@gmail.com> X-Mailer: git-send-email 2.21.0.rc0.328.g0e39304f8d In-Reply-To: <20190216113346.25000-1-pclouds@gmail.com> References: <20190207103326.10693-1-pclouds@gmail.com> <20190216113346.25000-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 Signed-off-by: Junio C Hamano --- diff.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/diff.c b/diff.c index 1cdbe8e688..5e16082091 100644 --- a/diff.c +++ b/diff.c @@ -4939,6 +4939,9 @@ static void prep_parse_options(struct diff_options *options) N_("synonym for --dirstat=files,param1,param2..."), PARSE_OPT_NONEG | PARSE_OPT_OPTARG, diff_opt_dirstat), + OPT_BIT_F(0, "check", &options->output_format, + N_("warn if changes introduce conflict markers or whitespace errors"), + DIFF_FORMAT_CHECKDIFF, PARSE_OPT_NONEG), OPT_END() }; @@ -4967,9 +4970,7 @@ int diff_opt_parse(struct diff_options *options, return ac; /* Output format options */ - if (!strcmp(arg, "--check")) - options->output_format |= DIFF_FORMAT_CHECKDIFF; - else if (!strcmp(arg, "--summary")) + if (!strcmp(arg, "--summary")) options->output_format |= DIFF_FORMAT_SUMMARY; else if (!strcmp(arg, "--patch-with-stat")) { enable_patch_output(&options->output_format); From patchwork Sat Feb 16 11:33:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10816181 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 4899117D5 for ; Sat, 16 Feb 2019 11:34:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 382B528D3E for ; Sat, 16 Feb 2019 11:34:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CC7B2CD46; Sat, 16 Feb 2019 11:34:36 +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 1715228D3E for ; Sat, 16 Feb 2019 11:34:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727760AbfBPLee (ORCPT ); Sat, 16 Feb 2019 06:34:34 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:40828 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727658AbfBPLed (ORCPT ); Sat, 16 Feb 2019 06:34:33 -0500 Received: by mail-pl1-f195.google.com with SMTP id bj4so6289307plb.7 for ; Sat, 16 Feb 2019 03:34:33 -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=504YtP9c1Vs48gl3br293hIlq3E4PGdQAmXfEyWhldU=; b=KtfxWk4uMpfCk36ophG6WjK1FvyTRP1tQLBAjF1eSW7AKZXYNyeF/zl3xUF6tFCjag XUHRQkZMh0r18lJTp/luTZRASp5w5aDcohhb7py997ozqnbIImdDCuA2oMclW2NyYp1V gxhjbD68zgvkQNzCx8rbQpryzcTNbWUH0is304iACMO6wGRCDOY9gFkqW5/Sp0iTjTFN EzuOD+qr98OzRqjorS/ThBj2+Jx4HrAN+m2a+V1caZLIpiplLcjE/NyXd1uWF2XqJbDA hAMRpF8EMFu6SZ1v2jGUClkT6ea1Oi63y73EkQS1GkAiaxHeVeDplGxRolM4FUGXJEs/ z9NQ== 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=504YtP9c1Vs48gl3br293hIlq3E4PGdQAmXfEyWhldU=; b=DQ+f4IaiwVAW02LHpEI8Tpw84JoEpGeGISkYRmxwgjjcENkTuTpSyFEXPZ7mascnQc 4oPB1pJRLNTBQkCML7R0eCA/gM099SWpAyQY/imZVfdCZxe79X/wImSHSFg5vGqX7mtE EAn2H+CtLnG80XaLkjqalxaCkmDIc+mtn06k6qsK1hhMKP6EH5nsw9ihUt8Eqci5WZMq HWK+9mZiqh+dr/+E/VuxWaf5aLafLEdTxIbeOVZBB8IWAK75KlW4n2KKJ95TWhJf8zaw CFkSVk9PBpXTfhm31mtRZ3f7yc4xlr6LWGgkM2yHtmSktkhceQMrnvv7gO/+2HiyfMbU nOGg== X-Gm-Message-State: AHQUAub4gcGjmq9WUQz1tVAVrrx5pQJA/paHE6ta6cXQu2NAbAoIvJc+ NdXHd7JdrT1VLW74fG6VigI= X-Google-Smtp-Source: AHgI3IZ01JbXHfxVxN3H9UGSAnledGr7g9L2JIFX8j3Y/BIKEvRAU7JQ+xxC+I4tjAkV2Rw2xjiTUw== X-Received: by 2002:a17:902:7882:: with SMTP id q2mr15415598pll.305.1550316873098; Sat, 16 Feb 2019 03:34:33 -0800 (PST) Received: from ash ([115.72.21.220]) by smtp.gmail.com with ESMTPSA id y21sm9532633pfe.57.2019.02.16.03.34.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Feb 2019 03:34:32 -0800 (PST) Received: by ash (sSMTP sendmail emulation); Sat, 16 Feb 2019 18:34:28 +0700 From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, gitster@pobox.com, =?utf-8?q?SZEDER_G=C3=A1bor?= Subject: [PATCH v2 05/21] diff-parseopt: convert --summary Date: Sat, 16 Feb 2019 18:33:30 +0700 Message-Id: <20190216113346.25000-6-pclouds@gmail.com> X-Mailer: git-send-email 2.21.0.rc0.328.g0e39304f8d In-Reply-To: <20190216113346.25000-1-pclouds@gmail.com> References: <20190207103326.10693-1-pclouds@gmail.com> <20190216113346.25000-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 Signed-off-by: Junio C Hamano --- diff.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/diff.c b/diff.c index 5e16082091..0276f25200 100644 --- a/diff.c +++ b/diff.c @@ -4942,6 +4942,9 @@ static void prep_parse_options(struct diff_options *options) OPT_BIT_F(0, "check", &options->output_format, N_("warn if changes introduce conflict markers or whitespace errors"), DIFF_FORMAT_CHECKDIFF, PARSE_OPT_NONEG), + OPT_BIT_F(0, "summary", &options->output_format, + N_("condensed summary such as creations, renames and mode changes"), + DIFF_FORMAT_SUMMARY, PARSE_OPT_NONEG), OPT_END() }; @@ -4970,9 +4973,7 @@ int diff_opt_parse(struct diff_options *options, return ac; /* Output format options */ - if (!strcmp(arg, "--summary")) - options->output_format |= DIFF_FORMAT_SUMMARY; - else if (!strcmp(arg, "--patch-with-stat")) { + if (!strcmp(arg, "--patch-with-stat")) { enable_patch_output(&options->output_format); options->output_format |= DIFF_FORMAT_DIFFSTAT; } else if (!strcmp(arg, "--name-only")) From patchwork Sat Feb 16 11:33:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10816183 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 7C64C922 for ; Sat, 16 Feb 2019 11:34:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CE5428D3E for ; Sat, 16 Feb 2019 11:34:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6170A2CD46; Sat, 16 Feb 2019 11:34:40 +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 02C9628D3E for ; Sat, 16 Feb 2019 11:34:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727826AbfBPLej (ORCPT ); Sat, 16 Feb 2019 06:34:39 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:43778 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727658AbfBPLei (ORCPT ); Sat, 16 Feb 2019 06:34:38 -0500 Received: by mail-pg1-f196.google.com with SMTP id v28so6073413pgk.10 for ; Sat, 16 Feb 2019 03:34:38 -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=mx3YU67jcYE6ZV/aAOaTSKW9TuP6stK+x1JgVNbadUU=; b=CrlVE+y/moSvhJZUimyJ8fsV05ArFMuW8elkD8D4PETvv1be8bEANhgLvZDmr/MvJn Bn6IBTX2ic3RkI/p3zaW13MaiRHyqHEwBjOYkNlEyWicyPqiv6hLPHuO0faMLRGzG5Rw DM19lepdLp3Ur+/ZNJeF3npSAuMTe/PrOv9ofaAYdjGPS9k5vG4QgBkyTrMesWG19XNV kH4z61VzCcYpTuj/CW3YPe+3hEX6+KSyx6SLtA+pYxFDa2LTV5LCX5jYJJD6dME48Pzh iaz47upuVQDU4XHVLaFItnC0+tj+3dHsBJ9r48sV/LncGeOFZvIsZwQd4gEzTOtEIfuD FL8w== 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=mx3YU67jcYE6ZV/aAOaTSKW9TuP6stK+x1JgVNbadUU=; b=fItg5IPPV8w7Q+QJImX4QUG76QE8Cmils90q1NQuplp4PmA7j7IDJupKZ2F7GHdT02 FyoXUfoXLP5imTj8PBjF40kovNJIyBK23NzC/eqMbAi2rQA8Nq3Pz4d9UJgSoeLvTvb6 MZgwDbRAN20lM0sI94wzqspOZwVXcAqYr+zFH8GYDqxJfKYTKKm/8tMRhUBd94g4m2ak VPC4IrLUvaIROtbiBL8rtvhlGENOAAydrVO7SXfxb7ATPrTFUnXhnuU4MZyVZ0jSUqt/ St+lbvfcnpu3b7OLp63aAATf3xFV5dMSiy3iKEd2fvHQW2C5L3vzimDjJOBkpdgBoMc5 hAPQ== X-Gm-Message-State: AHQUAuY+zr4KzlWdL2bDSkJxvQSULKrE6OtMApEksbfsJIIRTFjgYXKt mEJAghddFWxnmOoCFYXFM4E= X-Google-Smtp-Source: AHgI3Ibd95viql6BEeTbH0uHCniADrQQp81AlSFoaub7V5FiinwpO2dxkzEP+uv09Oc+rXZIEMR8aw== X-Received: by 2002:a62:4188:: with SMTP id g8mr14853247pfd.205.1550316877850; Sat, 16 Feb 2019 03:34:37 -0800 (PST) Received: from ash ([115.72.21.220]) by smtp.gmail.com with ESMTPSA id f12sm9539981pgo.13.2019.02.16.03.34.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Feb 2019 03:34:37 -0800 (PST) Received: by ash (sSMTP sendmail emulation); Sat, 16 Feb 2019 18:34:33 +0700 From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, gitster@pobox.com, =?utf-8?q?SZEDER_G=C3=A1bor?= Subject: [PATCH v2 06/21] diff-parseopt: convert --patch-with-stat Date: Sat, 16 Feb 2019 18:33:31 +0700 Message-Id: <20190216113346.25000-7-pclouds@gmail.com> X-Mailer: git-send-email 2.21.0.rc0.328.g0e39304f8d In-Reply-To: <20190216113346.25000-1-pclouds@gmail.com> References: <20190207103326.10693-1-pclouds@gmail.com> <20190216113346.25000-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 Signed-off-by: Junio C Hamano --- diff.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/diff.c b/diff.c index 0276f25200..b9811aefef 100644 --- a/diff.c +++ b/diff.c @@ -4921,6 +4921,10 @@ static void prep_parse_options(struct diff_options *options) N_("synonym for '-p --raw'"), DIFF_FORMAT_PATCH | DIFF_FORMAT_RAW, DIFF_FORMAT_NO_OUTPUT), + OPT_BITOP(0, "patch-with-stat", &options->output_format, + N_("synonym for '-p --stat'"), + DIFF_FORMAT_PATCH | DIFF_FORMAT_DIFFSTAT, + DIFF_FORMAT_NO_OUTPUT), OPT_BIT_F(0, "numstat", &options->output_format, N_("machine friendly --stat"), DIFF_FORMAT_NUMSTAT, PARSE_OPT_NONEG), @@ -4973,10 +4977,7 @@ int diff_opt_parse(struct diff_options *options, return ac; /* Output format options */ - if (!strcmp(arg, "--patch-with-stat")) { - enable_patch_output(&options->output_format); - options->output_format |= DIFF_FORMAT_DIFFSTAT; - } else if (!strcmp(arg, "--name-only")) + if (!strcmp(arg, "--name-only")) options->output_format |= DIFF_FORMAT_NAME; else if (!strcmp(arg, "--name-status")) options->output_format |= DIFF_FORMAT_NAME_STATUS;