grep: context output omits group separators between files
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
Research direction
Start by running the provided reproducer and comparing uutils output with GNU grep, including -r, --no-group-separator, and --group-separator=STRING. Trace the context-group handling for multiple input files and add or update coverage so separators appear at file boundaries while existing within-file behavior remains unchanged.
Written by the indexing model from the issue text.
Description
When context output continues into another file, uutils grep does not print a group separator before the first group in that file.
printf 'hit\nno\nno\nhit\n' > first
printf 'hit\n' > second
grep -n -C0 hit first second
The current uutils output is:
first:1:hit
--
first:4:hit
second:1:hit
GNU grep 3.12 inserts another separator between the files:
first:1:hit
--
first:4:hit
--
second:1:hit
The same difference appears with -r when matches come from two explicitly named directories. All commands exit 0 with empty stderr. GNU also applies --no-group-separator and --group-separator=STRING across file boundaries.
#24 and #42 concern groups within a single file.
- Dominant language
- Rust
- Stars
- 133
- Forks
- 25
- Avg merge
- 19h 49m
- Merged PRs (30d)
- 11
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from uutils/grep
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Dependency DashboardOpen
Difficulty 1/5 Under an hour Newbie friendliness 20/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 3 days
-
[BUG] Filename sequence expansion (`+`) panics on numeric values exceeding `i32::MAX`Possibly taken @muntasir-396 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
CCExtractor/ccextractor#2402 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100