Git development
 help / color / mirror / Atom feed
* git grep bug with --column and --only-matching
@ 2026-04-21  5:03 Brandon Chinn
  2026-04-21 20:33 ` René Scharfe
  2026-04-24 21:04 ` [PATCH] grep: fix --column --only-match for 2nd and later matches René Scharfe
  0 siblings, 2 replies; 5+ messages in thread
From: Brandon Chinn @ 2026-04-21  5:03 UTC (permalink / raw)
  To: git

I'm encountering a bug when using `git grep` with both `--column` and
`--only-matching`, is this a known limitation?

Repro:

```
$ echo 'x   x   x' > repro.txt

$ grep -bo x repro.txt
0:x
4:x
8:x

$ git grep --no-index -o -n --column x repro.txt
repro.txt:1:  1:x
repro.txt:1:  2:x
repro.txt:1:  6:x
```

[System Info]
git version:
git version 2.51.1
cpu: arm64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
libcurl: 8.7.1
zlib: 1.2.12
SHA-1: SHA1_DC
SHA-256: SHA256_BLK
default-ref-format: files
default-hash: sha1
uname: Darwin 25.3.0 Darwin Kernel Version 25.3.0: Wed Jan 28 20:56:34
PST 2026; root:xnu-12377.91.3~2/RELEASE_ARM64_T8112 arm64
compiler info: clang: 17.0.0 (clang-1700.0.13.3)
libc info: no libc information available
$SHELL (typically, interactive shell): /bin/zsh

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

end of thread, other threads:[~2026-05-04 13:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-21  5:03 git grep bug with --column and --only-matching Brandon Chinn
2026-04-21 20:33 ` René Scharfe
2026-04-23  9:44   ` Phillip Wood
2026-04-24 21:04 ` [PATCH] grep: fix --column --only-match for 2nd and later matches René Scharfe
2026-05-04 13:10   ` Phillip Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox