From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B948C433F5 for ; Mon, 10 Oct 2022 17:46:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229710AbiJJRqN (ORCPT ); Mon, 10 Oct 2022 13:46:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbiJJRqH (ORCPT ); Mon, 10 Oct 2022 13:46:07 -0400 Received: from pb-smtp2.pobox.com (pb-smtp2.pobox.com [64.147.108.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 851EB356DE for ; Mon, 10 Oct 2022 10:46:03 -0700 (PDT) Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 91A3415D296; Mon, 10 Oct 2022 13:46:02 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=w/xhxCP5q6gf TIsd2VXuHdXg5QvqJiyyL1r+lmoLXTw=; b=o6nctp6Fd7Xlb/25wvGcYaRpGZFP S0Uosl1BvdW73o/l3lIOYtpSO+vIOZvGtr8wNws/e+mPHNDfuuTQuw7Q8utCh4zd aZNFuaI3npBsibcLiT1yKswGtA3kWfYvCGVzSQIkcVG8ek8FgTEUhrDnJKODuG8N NG7axatQb+8BJ5k= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 8853315D295; Mon, 10 Oct 2022 13:46:02 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.83.5.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 5A7D815D293; Mon, 10 Oct 2022 13:46:01 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Cc: git@vger.kernel.org, orygaw , rsbecker@nexbridge.com, Taylor Blau Subject: Re: [PATCH] log: require --grep for --invert-grep and --all-match, fix segfault References: Date: Mon, 10 Oct 2022 10:45:59 -0700 In-Reply-To: (Junio C. Hamano's message of "Mon, 10 Oct 2022 10:34:53 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Pobox-Relay-ID: 67B28D44-48C3-11ED-8E57-307A8E0A682E-77302942!pb-smtp2.pobox.com Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Junio C Hamano writes: > =C3=86var Arnfj=C3=B6r=C3=B0 Bjarmason writes: > >> Neither the "--invert-grep" option added in [1] nor the earlier >> "--all-match" option added in [2] were intended to be used >> stand-alone. > > Mostly yes, but with "to be used" -> "to take effect". > > "[alias] lga =3D log --all-match" would be equivalent to "log" > unless the command line starts talking about "--grep", which is > quite handy. > > So the real fix would be not to forbid the standalone passing of the > option to the command, but to fix the over-eager freeing of an > unallocated resource, introduced more recently, I would suspect. On the other hand, I do not think "--invert-grep" is useful in the same way. The only usage I can think of is to omit merges by looking for substring "^Merge", but then we already have a more robust "--no-merges" option for that purpose. But both uses the same mechanism, I would say treating them the same, i.e. silently ignoring these when --grep is not given, would be the most sensible. Thanks.