Summary
libra grep diverges from Git in two independently reproducible parts of the upstream scenario t7810-grep.sh test 200 (inside git repository but with --no-index):
grep --no-index --exclude-standard is rejected as an unsupported option.
- From a subdirectory,
grep --untracked searches from the repository root instead of limiting output to the current directory.
This is tracked by libra-testcases as TC-1596. Merely normalizing Git's .gitignore to Libra's .libraignore is insufficient because both differences affect behavior, not just output wording.
Versions
- Libra:
0.22.19
- Git control:
2.55.0.782.g1630431f32
- Platform: macOS, case-insensitive APFS
- Upstream source: Git commit
1630431f326e15fcde608827b5ff38422528eb59, t/t7810-grep.sh lines 1288-1328
Reproduction
Run the following with LIBRA set to the Libra binary:
set -eu
work=$(mktemp -d)
trap 'rm -rf "$work"' EXIT
"$LIBRA" init -q --initial-branch=main "$work/repo"
mkdir -p "$work/repo/sub"
printf 'hello\n' >"$work/repo/file1"
printf 'world\n' >"$work/repo/sub/file2"
printf '.*o*\n' >"$work/repo/.libraignore"
cd "$work/repo"
"$LIBRA" grep --no-index --exclude-standard o
cd sub
"$LIBRA" grep --untracked o
The equivalent Git setup uses .gitignore with the same contents.
Actual behavior
At the repository root:
$ libra grep --no-index --exclude-standard o
error: unexpected argument '--exclude-standard' found
Error-Code: LBR-CLI-002
Usage: libra grep --no-index [PATTERN] [PATHS]...
The command exits 129 and produces no matches.
From repo/sub:
$ libra grep --untracked o
file1:hello
sub/file2:world
The command exits 0 but includes a file outside the current subdirectory and uses repository-root-relative paths.
Expected behavior
At the repository root, matching Git:
$ git grep --no-index --exclude-standard o
file1:hello
sub/file2:world
The command should exit 0. --exclude-standard should apply the product's native standard ignore rules, excluding the matching native ignore file.
From repo/sub, matching Git's current-directory scope:
$ git grep --untracked o
file2:world
The command should exit 0, omit root-level file1, and report paths relative to the current subdirectory.
Additional observations
These parts already behave equivalently after mapping the native ignore filenames:
grep o: both exit 1 with no output in the new repository.
grep --untracked o from the repository root: both output file1:hello and sub/file2:world.
grep --no-index o from the repository root: both output the native ignore file plus the two matching content files.
grep --no-index o from sub: both output only file2:world.
The original upstream-style Libra run stops earlier because --no-index also sees Libra's automatically generated .libraignore; a native-interface comparison removes that superficial difference and exposes the two behavioral gaps above.
Summary
libra grepdiverges from Git in two independently reproducible parts of the upstream scenariot7810-grep.shtest 200 (inside git repository but with --no-index):grep --no-index --exclude-standardis rejected as an unsupported option.grep --untrackedsearches from the repository root instead of limiting output to the current directory.This is tracked by libra-testcases as TC-1596. Merely normalizing Git's
.gitignoreto Libra's.libraignoreis insufficient because both differences affect behavior, not just output wording.Versions
0.22.192.55.0.782.g1630431f321630431f326e15fcde608827b5ff38422528eb59,t/t7810-grep.shlines 1288-1328Reproduction
Run the following with
LIBRAset to the Libra binary:The equivalent Git setup uses
.gitignorewith the same contents.Actual behavior
At the repository root:
The command exits 129 and produces no matches.
From
repo/sub:The command exits 0 but includes a file outside the current subdirectory and uses repository-root-relative paths.
Expected behavior
At the repository root, matching Git:
The command should exit 0.
--exclude-standardshould apply the product's native standard ignore rules, excluding the matching native ignore file.From
repo/sub, matching Git's current-directory scope:The command should exit 0, omit root-level
file1, and report paths relative to the current subdirectory.Additional observations
These parts already behave equivalently after mapping the native ignore filenames:
grep o: both exit 1 with no output in the new repository.grep --untracked ofrom the repository root: both outputfile1:helloandsub/file2:world.grep --no-index ofrom the repository root: both output the native ignore file plus the two matching content files.grep --no-index ofromsub: both output onlyfile2:world.The original upstream-style Libra run stops earlier because
--no-indexalso sees Libra's automatically generated.libraignore; a native-interface comparison removes that superficial difference and exposes the two behavioral gaps above.