From patchwork Sun Mar 24 08:19:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Duy Nguyen X-Patchwork-Id: 10867363 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 537B5922 for ; Sun, 24 Mar 2019 08:21:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4229529829 for ; Sun, 24 Mar 2019 08:21:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 36A3A29830; Sun, 24 Mar 2019 08:21: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 D9E3329829 for ; Sun, 24 Mar 2019 08:21:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728509AbfCXIV2 (ORCPT ); Sun, 24 Mar 2019 04:21:28 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:44215 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727727AbfCXIV2 (ORCPT ); Sun, 24 Mar 2019 04:21:28 -0400 Received: by mail-pf1-f196.google.com with SMTP id a3so4278325pff.11 for ; Sun, 24 Mar 2019 01:21:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=n8/8INEw9mXjh7augXRGK+u6W5dhTqMFJTxPb9iszv8=; b=vboFsmhhG6vVz+IubNZ82kBuZInfjhZI02n/upkp2szUeAnh87Mgnv2NDADhCZZxDY 4Ic0Jc6yWEAiqCa3DtylKhfBhPcUrMZtcfMh2h3DtxkeWgZ1tls+zsKRt5SBxbPPc4Y+ LvpZqVj6a1j5QYdQt33eTWBfXk1e1xbI+sDt41rqlVCgXYCHcuxnRMVLkHYcinzpUd/1 v62u0IClMd1tucoVjO7QgkC521Ne23ztQ3jKVIZEFpoYp3yk8dUukuv2YBMzVVcFjS9A CYAWX+14OblsGW0LiR80HkpY/FM4TYTTijNbT5JGflv6+LwNSNlOjHFHlZMMa+e6Y+OL 9lzQ== 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=n8/8INEw9mXjh7augXRGK+u6W5dhTqMFJTxPb9iszv8=; b=qKzShcG7PLoeUOD0GHiGPV7XuGl5wy20Bxg+gOZEEygoWPAm7go6ejS/Jg30Ay+i/R H9Pi/vL7mbLjKA7Ub9n6k/ogg1U+YlFJEJD7IZEcHm7EWha5Lr27oeoXkHENNz8brqn+ wKD8+Otnrkkw+VZV8eMGfSZVN6vQDpexdOz5f7PdEmnoWarAWpmBd9YTt6c9io3WcG7e 7YLsSOH6wK4Tt7R/B9abgW/rujEr3Z+VwzzlYt4twEbkTjp+ePE9uWkkcg0ScVw/mrez glBevGY7CM2kHuPkCqWAGQqvzkndK5t6Ryx/ZgB0gd/T70vyzlPxklSE+CO0ngdFErDj JNkg== X-Gm-Message-State: APjAAAXefgWLoF4+VIppdfrJtLU1iyjp0s8VeHHluUPxiMumQrFYrRiW 8idyUk7E4B25oK78Ff7af88= X-Google-Smtp-Source: APXvYqzYrtaUixiOxDmtzKFsk6ENfAGs7sfFZasNvIHlx4Lh/K3OLb4Ca6ru7G4HRRUrJKlrDcaAqg== X-Received: by 2002:a17:902:e3:: with SMTP id a90mr18365247pla.45.1553415687704; Sun, 24 Mar 2019 01:21:27 -0700 (PDT) Received: from ash ([171.226.148.85]) by smtp.gmail.com with ESMTPSA id k83sm40750898pfj.178.2019.03.24.01.21.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Mar 2019 01:21:27 -0700 (PDT) Received: by ash (sSMTP sendmail emulation); Sun, 24 Mar 2019 15:21:22 +0700 From: =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= To: pclouds@gmail.com Cc: git@vger.kernel.org, Junio C Hamano , =?utf-8?q?Marti?= =?utf-8?q?n_=C3=85gren?= Subject: [PATCH v2 03/20] diff-parseopt: convert -z Date: Sun, 24 Mar 2019 15:19:57 +0700 Message-Id: <20190324082014.2041-4-pclouds@gmail.com> X-Mailer: git-send-email 2.21.0.548.gd3c7d92dc2 In-Reply-To: <20190324082014.2041-1-pclouds@gmail.com> References: <20190320114703.18659-1-pclouds@gmail.com> <20190324082014.2041-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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/diff.c b/diff.c index 8255db6966..2b1d015553 100644 --- a/diff.c +++ b/diff.c @@ -5238,6 +5238,9 @@ static void prep_parse_options(struct diff_options *options) OPT_CALLBACK_F(0, "ws-error-highlight", options, N_(""), N_("highlight whitespace errors in the 'context', 'old' or 'new' lines in the diff"), PARSE_OPT_NONEG, diff_opt_ws_error_highlight), + OPT_SET_INT('z', NULL, &options->line_termination, + N_("do not munge pathnames and use NULs as output field terminators in --raw or --numstat"), + 0), OPT_CALLBACK_F(0, "output-indicator-new", &options->output_indicators[OUTPUT_INDICATOR_NEW], N_(""), @@ -5410,8 +5413,6 @@ int diff_opt_parse(struct diff_options *options, } /* misc options */ - else if (!strcmp(arg, "-z")) - options->line_termination = 0; else if ((argcount = short_opt('l', av, &optarg))) { options->rename_limit = strtoul(optarg, NULL, 10); return argcount;