From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, orygaw <orygaw@protonmail.com>,
rsbecker@nexbridge.com, Taylor Blau <me@ttaylorr.com>
Subject: Re: [PATCH] log: require --grep for --invert-grep and --all-match, fix segfault
Date: Mon, 10 Oct 2022 10:45:59 -0700 [thread overview]
Message-ID: <xmqq35bv4lns.fsf@gitster.g> (raw)
In-Reply-To: <xmqq7d174m6a.fsf@gitster.g> (Junio C. Hamano's message of "Mon, 10 Oct 2022 10:34:53 -0700")
Junio C Hamano <gitster@pobox.com> writes:
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> 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 = 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.
next prev parent reply other threads:[~2022-10-10 17:46 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-10 14:33 Git BUG 2.37.3 and 2.38.0 orygaw
2022-10-10 15:40 ` rsbecker
2022-10-10 15:48 ` Taylor Blau
2022-10-10 17:02 ` Junio C Hamano
2022-10-10 16:57 ` [PATCH] log: require --grep for --invert-grep and --all-match, fix segfault Ævar Arnfjörð Bjarmason
2022-10-10 17:34 ` Junio C Hamano
2022-10-10 17:45 ` Junio C Hamano [this message]
2022-10-10 18:48 ` Ævar Arnfjörð Bjarmason
2022-10-10 19:00 ` Taylor Blau
2022-10-11 9:48 ` [PATCH v2] grep.c: remove "extended" in favor of "pattern_expression", " Ævar Arnfjörð Bjarmason
2022-10-11 15:46 ` Junio C Hamano
2022-10-10 17:41 ` [PATCH 0/2] grep: tolerate NULL argument to free_grep_expr() Taylor Blau
2022-10-10 17:41 ` [PATCH 1/2] t4202: demonstrate `git log --invert-grep` segfault Taylor Blau
2022-10-10 17:41 ` [PATCH 2/2] grep.c: tolerate NULL grep_expr in free_pattern_expr() Taylor Blau
2022-10-10 17:54 ` Junio C Hamano
2022-10-10 18:10 ` Taylor Blau
2022-10-10 18:11 ` Junio C Hamano
2022-10-10 18:14 ` Taylor Blau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq35bv4lns.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=me@ttaylorr.com \
--cc=orygaw@protonmail.com \
--cc=rsbecker@nexbridge.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).