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-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 7302B1F66F for ; Tue, 3 Nov 2020 18:57:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728527AbgKCS5M (ORCPT ); Tue, 3 Nov 2020 13:57:12 -0500 Received: from cloud.peff.net ([104.130.231.41]:46516 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725892AbgKCS5M (ORCPT ); Tue, 3 Nov 2020 13:57:12 -0500 Received: (qmail 6892 invoked by uid 109); 3 Nov 2020 18:57:12 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Tue, 03 Nov 2020 18:57:12 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 3590 invoked by uid 111); 3 Nov 2020 18:57:11 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Tue, 03 Nov 2020 13:57:11 -0500 Authentication-Results: peff.net; auth=none Date: Tue, 3 Nov 2020 13:57:11 -0500 From: Jeff King To: Junio C Hamano Cc: SZEDER =?utf-8?B?R8OhYm9y?= , Sathyajith Bhat , git@vger.kernel.org Subject: Re: Segfault in git when using git logs Message-ID: <20201103185711.GA461461@coredump.intra.peff.net> References: <20201102144321.GA3962443@coredump.intra.peff.net> <20201103101553.GH24813@szeder.dev> <20201103182102.GA459792@coredump.intra.peff.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Tue, Nov 03, 2020 at 10:34:09AM -0800, Junio C Hamano wrote: > > On our side, I don't think it would be _wrong_ to catch and disallow the > > combination. But it may be nicer to them if we continue to quietly > > ignore --follow and the pathspec in that case, for working with older > > versions. (OTOH, if I understand correctly they're segfaulting every > > time VS Code is used with v2.29 now, so they may have to accept it as an > > urgent fix anyway). > > So something like this won't harm VS Code more than we currently do, > while telling users what is wrong with their command line? Yeah, I was wondering if we'd want the patch you sent, or if we should turn those die() calls into warning() and disable the flags up front. > We may still want the "silently disable follow" at low-level > protection, but that does not give feedback why the end-user option > is silently ignored, so... I'd be just as happy to leave it out, if we think it isn't triggerable. The segfault would let people know we missed a spot. ;) > diff --git c/builtin/log.c w/builtin/log.c > index 9f939e6cdf..8811084f02 100644 > --- c/builtin/log.c > +++ w/builtin/log.c > @@ -206,6 +206,13 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix, > if (argc > 1) > die(_("unrecognized argument: %s"), argv[1]); > > + if (rev->line_level_traverse) { > + if (rev->diffopt.filter) > + die(_("-L: cannot be used with pathspec")); Should this be checking rev->diffopt.pathspec.nr? I could well believe that --diff-filter=A does not work with "-L" either, but that is a separate story. -Peff