Re: Crash on empty pickaxe argument
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Feb 17, 2025, 01:58 UTC
- Message-ID
- <Z7KX2y-dXaZuPrW4@tapette.crustytoothpaste.net>
- In-Reply-To
- <b59b75a1ad77f59cc8d81e2dd5cc9607e53b50af.camel@gmail.com>
On 2025-02-17 at 01:24:14, Jared Van Bortel wrote:
> Hi all,
Hi,
Show 19 quoted lines
> I fat-fingered my enter key today and noticed this crash: > > $ git --version > git version 2.48.1 > $ mkdir foo && cd foo > $ git init > <snip> > $ git commit --allow-empty -m "foo" > [master (root-commit) ed4e080] foo > $ git log -S "" > BUG: diffcore-pickaxe.c:241: should have needle under -G or -S > [1] 65421 IOT instruction (core dumped) git log -S "" > $ git log -G "" > BUG: diffcore-pickaxe.c:241: should have needle under -G or -S > [1] 65457 IOT instruction (core dumped) git log -G "" > > > Well, it says BUG right there. It probably shouldn't crash. Relevant > backtrace for -S:
Thanks for the report. I agree this is a bug and we shouldn't crash. I think the right thing to do here is reject empty arguments since those aren't actually very useful, so I'm in the process of writing a patch to do that now, which I'll send out either later this evening or tomorrow, depending on when CI finishes running.
-- brian m. carlson (they/them or he/him) Toronto, Ontario, CA