From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 54DBB1F727 for ; Tue, 21 Jun 2022 16:01:21 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=web.de header.i=@web.de header.b="U2WXEDgw"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353450AbiFUQAc (ORCPT ); Tue, 21 Jun 2022 12:00:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353549AbiFUP7s (ORCPT ); Tue, 21 Jun 2022 11:59:48 -0400 Received: from mout.web.de (mout.web.de [217.72.192.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 215AC2CE2B for ; Tue, 21 Jun 2022 08:59:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1655827133; bh=KlH12UTP94FfgTThhtAHWOm4HAIBJR7b8Qk0VH1W7es=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=U2WXEDgw1FQe/1Ry7sRv6gIZsoKoOAJyE3la5qkKHA+KDrv6QZ8eI/NlOWbYWV7Pj K8PL3vC6iL2sbmC6zqJxk/q5pZ6rgv18kPU8LJn21tI9Jgn2SL9+SevOUZuLKvvQWE 1aBlQj9TE71+UN38tTg42tsvkI2JhcXRwoWqx2sg= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.178.29] ([79.203.27.15]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1Ma0Pm-1o96CH0WnM-00WHir; Tue, 21 Jun 2022 17:58:53 +0200 Message-ID: <95d7609e-4cb5-c87e-0120-144f1f094241@web.de> Date: Tue, 21 Jun 2022 17:58:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH 1/2] combine-diff: abort if --ignore-matching-lines is given Content-Language: en-US To: Junio C Hamano Cc: =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , git@vger.kernel.org, =?UTF-8?B?TWljaGHFgiBLxJlwaWXFhA==?= References: <220524.86leurw3my.gmgdl@evledraar.gmail.com> <220524.86v8tuvfl1.gmgdl@evledraar.gmail.com> <49bcadd1-7dc2-d5ee-36a5-59456450aeca@web.de> From: =?UTF-8?Q?Ren=c3=a9_Scharfe?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:H9eRWELFQuZSsydYhNt5ww3rO0yorj0qKUbZs5rx1k289J/rEzb KzY+onjYh5iAogDYnXu0RqEnoMousSGtXigPlUGUDdruv++zxC90pezL2tk38marFx9fPiL FgXsDWmcFV9v27A39H8vuvpGa5NKbUySj6h5RmIE3Xy7fo6+W3hlyZXH5VzI01toTWiuclO 5vPCMNRhWIjSsTICFs19Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:tWF9yDChA9E=:PEOr/uATjlYW99i67es2hr Sk5YAC7LY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HnkohsYxk95Fb/1 0pY+a4c8r0V76oA3eAeBPxoYQQR2msGZD+j Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Am 21.06.22 um 17:35 schrieb Junio C Hamano: > Ren=C3=A9 Scharfe writes: > >> The code for combined diffs doesn't currently support ignoring changes >> that match a regex. Abort and report that fact instead of running into >> a segfault. >> >> Signed-off-by: Ren=C3=A9 Scharfe >> --- >> combine-diff.c | 4 ++++ >> 1 file changed, 4 insertions(+) > > Makes sense. > >> diff --git a/combine-diff.c b/combine-diff.c >> index b724f02123..11df1d7f39 100644 >> --- a/combine-diff.c >> +++ b/combine-diff.c >> @@ -1498,6 +1498,10 @@ void diff_tree_combined(const struct object_id *= oid, >> int i, num_paths, needsep, show_log_first, num_parent =3D parents->nr= ; >> int need_generic_pathscan; >> >> + if (opt->ignore_regex_nr) >> + die("combined diff and '%s' cannot be used together", >> + "--ignore-matching-lines"); > > "X cannot be used together _with_ Y" perhaps? Not sure, but that type of message was recently unified (most common case: "options '%s' and '%s' cannot be used together") and "with" is only used in an untranslated BUG: $ git grep -e "cannot be used together" --and --not -e options '*.c' builtin/add.c: die(_("'%s' and pathspec arguments cannot = be used together"), "--pathspec-from-file"); builtin/am.c: "cannot be used togethe= r"), builtin/checkout.c: die(_("'%s' and pathspec arguments= cannot be used together"), "--pathspec-from-file"); builtin/clean.c: die(_("-x and -X cannot be used together")= ); builtin/commit.c: die(_("'%s' and pathspec arguments= cannot be used together"), "--pathspec-from-file"); builtin/commit.c: die(_("reword option of '%s' and path '%s'= cannot be used together"), "--fixup", *argv); builtin/commit.c: die(_("reword option of '%s' and '%s' cann= ot be used together"), builtin/describe.c: die(_("option '%s' and commit-ishes cannot= be used together"), "--dirty"); builtin/describe.c: die(_("option '%s' and commit-ishes cannot= be used together"), "--broken"); builtin/rebase.c: "cannot be used = together")); builtin/reset.c: die(_("'%s' and pathspec arguments= cannot be used together"), "--pathspec-from-file"); builtin/rev-list.c: die(_("marked counting and '%s' cannot be = used together"), "--objects"); builtin/rm.c: die(_("'%s' and pathspec arguments cannot = be used together"), "--pathspec-from-file"); builtin/stash.c: die(_("'%s' and pathspec arguments= cannot be used together"), "--pathspec-from-file"); revision.c: BUG("--single-worktree cannot be used toge= ther with submodule"); upload-pack.c: die("git upload-pack: deepen and deepen-since (or = deepen-not) cannot be used together"); So there doesn't seem to be a fully consistent style amongst these special cases. How about this? die(_("option '%s' and combined diffs cannot be used together"), > >> /* nothing to do, if no parents */ >> if (!num_parent) >> return; >> -- >> 2.36.1