-
-
Notifications
You must be signed in to change notification settings - Fork 660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect behavior of --git-ignore flag #614
Comments
Still an issue... |
I added the following to my alias lt='exa -lahT --ignore-glob=".git|$(ignore)"'
ignore() {
if [[ -f .gitignore ]]; then
local GIT_IGNORE='.gitignore'
else
local GIT_IGNORE="${HOME}/.gitignore_global"
fi
grep '\S' "${GIT_IGNORE}" 2>/dev/null |
tr -d '\r' |
grep -v '^#' |
sed 's/^\///;s/\/$//' |
paste -sd '|' -
} |
This has been fixed by #653. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've tested it in a dir with such structure:
I ran
exa --tree --git-ignore
with different versions of.gitignore
. There are 2 problemsexa
doesn't exclude directories if there's a backslash at the end of the line.IMO this one is the most annoying.
git
's docs say:and
It seems like the backslash at the end is a valid path in
.gitignore
butexa
doesn't exclude it..gitignore
:Output:
exa
only excludes directories and files if they are at the same level as.gitignore
.Docs say:
However,
exa
doesn't exclude files nor dirs inside other dirs..gitignore
:Output:
I've also tested what happens if I put
.gitignore
in a dir andexa
takes it into account. The behavior is expected (the same files are/are not excluded) but still not correct.This issue is related to #369.
I use this flag quite often and I'd be very happy if a shortened version was added :).
The text was updated successfully, but these errors were encountered: