git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug: git grep --no-index 123 /dev/stdin crashes with SIGABRT
@ 2023-10-14 15:42 ks1322 ks1322
  2023-10-14 18:12 ` Kristoffer Haugsbakk
  0 siblings, 1 reply; 15+ messages in thread
From: ks1322 ks1322 @ 2023-10-14 15:42 UTC (permalink / raw)
  To: git

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
`git grep --no-index 123 /dev/stdin` outside of git repository

What did you expect to happen? (Expected behavior)
Ability to grep input from stdin

What happened instead? (Actual behavior)
`git grep` crashed with SIGABRT

$ git grep --no-index 123 /dev/stdin
BUG: environment.c:215: git environment hasn't been setup
Aborted (core dumped)

What's different between what you expected and what actually happened?
Crash, no grep result

Anything else you want to add:
Plain grep can do that, so I suppose `git grep` could also:

$ echo -e "123\n456\n789" | grep 456 /dev/stdin
456

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.41.0
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 6.5.6-200.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Oct  6
19:02:35 UTC 2023 x86_64
compiler info: gnuc: 13.1
libc info: glibc: 2.37
$SHELL (typically, interactive shell): /bin/bash


[Enabled Hooks]
not run from a git repository - no hooks to show

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-10-20 18:06 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-14 15:42 Bug: git grep --no-index 123 /dev/stdin crashes with SIGABRT ks1322 ks1322
2023-10-14 18:12 ` Kristoffer Haugsbakk
2023-10-14 19:37   ` Kristoffer Haugsbakk
2023-10-14 21:02     ` [PATCH] grep: die gracefully when outside repository Kristoffer Haugsbakk
2023-10-15  3:26       ` Jeff King
2023-10-15  8:00         ` Kristoffer Haugsbakk
2023-10-15 17:57         ` Junio C Hamano
2023-10-17 16:42       ` Junio C Hamano
2023-10-17 19:51         ` Kristoffer Haugsbakk
2023-10-17 20:25           ` Junio C Hamano
2023-10-17 20:39       ` Junio C Hamano
2023-10-20 16:40       ` [PATCH v2] " Kristoffer Haugsbakk
2023-10-20 17:05         ` Eric Sunshine
2023-10-20 18:06           ` Junio C Hamano
2023-10-20 18:04       ` [PATCH v3] " Kristoffer Haugsbakk

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).