eza-community / eza

A modern alternative to ls
https://eza.rocks
MIT License
11.25k stars 201 forks source link

bug: --git-ignore not working with globbings on symlinks on ubuntu #294

Closed MartinFillon closed 8 months ago

MartinFillon commented 1 year ago

eza version: v0.11.1 [+git] command: eza -lah --git --git-ignore .gitignore file affected content:

bazel-*

Output without --git-ignore:

.rw-rw-r--    23 mfn  29 août  10:00  -- .bazelignore
.rw-rw-r--   718 mfn  29 août  10:00  -- .bazelrc
drwxrwxr-x     - mfn  12 sept. 16:56  -I .git
.rw-rw-r--    26 mfn  29 août  10:00  -- .gitattributes
drwxrwxr-x     - mfn  29 août  10:00  -- .github
.rw-rw-r--   284 mfn  29 août  10:00  -- .gitignore
.rw-rw-r--   686 mfn  29 août  10:00  -- .gitlint
drwxrwxr-x     - mfn  29 août  10:00  -- .http
drwxrwxr-x     - mfn  29 août  15:47  -I .ijwb
drwxrwxr-x     - mfn  31 août  11:28  -I .metals
drwxrwxr-x     - mfn  29 août  10:00  -- .run
.rw-rw-r--   577 mfn  29 août  10:00  -- .scalafmt.conf
drwxrwxr-x     - mfn  31 août  11:38  -I .trunk
drwxrwxr-x     - mfn  29 août  16:28  -I .vscode
drwxrwxr-x     - mfn   5 sept. 15:51  -- 3rdparty
drwxrwxr-x     - mfn  29 août  10:00  -- adex-services
drwxrwxr-x     - mfn  29 août  10:00  -- api
drwxrwxr-x     - mfn  29 août  10:00  -- apps
drwxrwxr-x     - mfn  29 août  10:00  -- bank-accounting-services
lrwxrwxrwx     - mfn  11 sept. 16:21  -- bazel-bin -> /home/mfn/.cache/bazel/_bazel_mfn/4c4fc07d94d1d7de773541c26cf1677e/execroot/mediarithmics_platform/bazel-out/k8-fastbuild/bin
lrwxrwxrwx     - mfn  11 sept. 16:21  -- bazel-mediarithmics-platform -> /home/mfn/.cache/bazel/_bazel_mfn/4c4fc07d94d1d7de773541c26cf1677e/execroot/mediarithmics_platform
lrwxrwxrwx     - mfn  11 sept. 16:21  -- bazel-out -> /home/mfn/.cache/bazel/_bazel_mfn/4c4fc07d94d1d7de773541c26cf1677e/execroot/mediarithmics_platform/bazel-out
lrwxrwxrwx     - mfn  11 sept. 16:21  -- bazel-testlogs -> /home/mfn/.cache/bazel/_bazel_mfn/4c4fc07d94d1d7de773541c26cf1677e/execroot/mediarithmics_platform/bazel-out/k8-fastbuild/testlogs
.rw-rw-r--   685 mfn  12 sept. 16:57  -I bazel_explain.log
drwxrwxr-x     - mfn  12 sept. 15:03  -- build-support
.rw-rw-r--  3,0k mfn  29 août  10:00  -- BUILD.bazel
drwxrwxr-x     - mfn  29 août  10:00  -- business-analytics
drwxrwxr-x     - mfn  29 août  10:00  -- campaign-delivery
drwxrwxr-x     - mfn  29 août  10:00  -- core-platform-services
drwxrwxr-x     - mfn  29 août  10:00  -- cql-schema
drwxrwxr-x     - mfn  29 août  10:00  -- datamart
.rw-rw-r--   19k mfn   5 sept. 15:51  -- dependencies.yaml
drwxrwxr-x     - mfn  29 août  10:00  -- deployment
.rw-rw-r--  4,8k mfn  29 août  10:00  -- deployment.md
drwxrwxr-x     - mfn  29 août  10:00  -- docker-example
drwxrwxr-x     - mfn  29 août  10:00  -- docs
drwxrwxr-x     - mfn  29 août  10:00  -- graphdb
drwxrwxr-x     - mfn  29 août  10:00  -- infra
drwxrwxr-x     - mfn  29 août  10:00  -- job-management-services
drwxrwxr-x     - mfn  29 août  10:00  -- lib
drwxrwxr-x     - mfn  29 août  10:00  -- mocks
drwxrwxr-x     - mfn  29 août  10:00  -- plugin-services
.rw-rw-r--  1,5k mfn  29 août  10:00  -- README.md
.rw-rw-r--  2,9k mfn  29 août  10:00  -- sonar-project.properties
drwxrwxr-x     - mfn  12 sept. 15:03  -- src
drwxrwxr-x     - mfn  12 sept. 15:03  -- tools
drwxrwxr-x     - mfn  29 août  10:00  -- types
drwxrwxr-x     - mfn  29 août  10:00  -- user-mapping-services
drwxrwxr-x     - mfn  29 août  10:00  -- virtual-platform
.rw-rw-r--  6,0k mfn   5 sept. 15:51  -- WORKSPACE

Output with --git-ignore:

.rw-rw-r--    23 mfn  29 août  10:00  -- .bazelignore
.rw-rw-r--   718 mfn  29 août  10:00  -- .bazelrc
.rw-rw-r--    26 mfn  29 août  10:00  -- .gitattributes
drwxrwxr-x     - mfn  29 août  10:00  -- .github
.rw-rw-r--   284 mfn  29 août  10:00  -- .gitignore
.rw-rw-r--   686 mfn  29 août  10:00  -- .gitlint
drwxrwxr-x     - mfn  29 août  10:00  -- .http
drwxrwxr-x     - mfn  29 août  10:00  -- .run
.rw-rw-r--   577 mfn  29 août  10:00  -- .scalafmt.conf
drwxrwxr-x     - mfn   5 sept. 15:51  -- 3rdparty
drwxrwxr-x     - mfn  29 août  10:00  -- adex-services
drwxrwxr-x     - mfn  29 août  10:00  -- api
drwxrwxr-x     - mfn  29 août  10:00  -- apps
drwxrwxr-x     - mfn  29 août  10:00  -- bank-accounting-services
lrwxrwxrwx     - mfn  11 sept. 16:21  -- bazel-bin -> /home/mfn/.cache/bazel/_bazel_mfn/4c4fc07d94d1d7de773541c26cf1677e/execroot/mediarithmics_platform/bazel-out/k8-fastbuild/bin
lrwxrwxrwx     - mfn  11 sept. 16:21  -- bazel-mediarithmics-platform -> /home/mfn/.cache/bazel/_bazel_mfn/4c4fc07d94d1d7de773541c26cf1677e/execroot/mediarithmics_platform
lrwxrwxrwx     - mfn  11 sept. 16:21  -- bazel-out -> /home/mfn/.cache/bazel/_bazel_mfn/4c4fc07d94d1d7de773541c26cf1677e/execroot/mediarithmics_platform/bazel-out
lrwxrwxrwx     - mfn  11 sept. 16:21  -- bazel-testlogs -> /home/mfn/.cache/bazel/_bazel_mfn/4c4fc07d94d1d7de773541c26cf1677e/execroot/mediarithmics_platform/bazel-out/k8-fastbuild/testlogs
drwxrwxr-x     - mfn  12 sept. 15:03  -- build-support
.rw-rw-r--  3,0k mfn  29 août  10:00  -- BUILD.bazel
drwxrwxr-x     - mfn  29 août  10:00  -- business-analytics
drwxrwxr-x     - mfn  29 août  10:00  -- campaign-delivery
drwxrwxr-x     - mfn  29 août  10:00  -- core-platform-services
drwxrwxr-x     - mfn  29 août  10:00  -- cql-schema
drwxrwxr-x     - mfn  29 août  10:00  -- datamart
.rw-rw-r--   19k mfn   5 sept. 15:51  -- dependencies.yaml
drwxrwxr-x     - mfn  29 août  10:00  -- deployment
.rw-rw-r--  4,8k mfn  29 août  10:00  -- deployment.md
drwxrwxr-x     - mfn  29 août  10:00  -- docker-example
drwxrwxr-x     - mfn  29 août  10:00  -- docs
drwxrwxr-x     - mfn  29 août  10:00  -- graphdb
drwxrwxr-x     - mfn  29 août  10:00  -- infra
drwxrwxr-x     - mfn  29 août  10:00  -- job-management-services
drwxrwxr-x     - mfn  29 août  10:00  -- lib
drwxrwxr-x     - mfn  29 août  10:00  -- mocks
drwxrwxr-x     - mfn  29 août  10:00  -- plugin-services
.rw-rw-r--  1,5k mfn  29 août  10:00  -- README.md
.rw-rw-r--  2,9k mfn  29 août  10:00  -- sonar-project.properties
drwxrwxr-x     - mfn  12 sept. 15:03  -- src
drwxrwxr-x     - mfn  12 sept. 15:03  -- tools
drwxrwxr-x     - mfn  29 août  10:00  -- types
drwxrwxr-x     - mfn  29 août  10:00  -- user-mapping-services
drwxrwxr-x     - mfn  29 août  10:00  -- virtual-platform
.rw-rw-r--  6,0k mfn   5 sept. 15:51  -- WORKSPACE

ArchLinux Output:

.rw-rw-r--    23 mfn  29 août  10:00  -- .bazelignore
.rw-rw-r--   718 mfn  29 août  10:00  -- .bazelrc
.rw-rw-r--    26 mfn  29 août  10:00  -- .gitattributes
drwxrwxr-x     - mfn  29 août  10:00  -- .github
.rw-rw-r--   284 mfn  29 août  10:00  -- .gitignore
.rw-rw-r--   686 mfn  29 août  10:00  -- .gitlint
drwxrwxr-x     - mfn  29 août  10:00  -- .http
drwxrwxr-x     - mfn  29 août  10:00  -- .run
.rw-rw-r--   577 mfn  29 août  10:00  -- .scalafmt.conf
drwxrwxr-x     - mfn   5 sept. 15:51  -- 3rdparty
drwxrwxr-x     - mfn  29 août  10:00  -- adex-services
drwxrwxr-x     - mfn  29 août  10:00  -- api
drwxrwxr-x     - mfn  29 août  10:00  -- apps
drwxrwxr-x     - mfn  29 août  10:00  -- bank-accounting-services
drwxrwxr-x     - mfn  12 sept. 15:03  -- build-support
.rw-rw-r--  3,0k mfn  29 août  10:00  -- BUILD.bazel
drwxrwxr-x     - mfn  29 août  10:00  -- business-analytics
drwxrwxr-x     - mfn  29 août  10:00  -- campaign-delivery
drwxrwxr-x     - mfn  29 août  10:00  -- core-platform-services
drwxrwxr-x     - mfn  29 août  10:00  -- cql-schema
drwxrwxr-x     - mfn  29 août  10:00  -- datamart
.rw-rw-r--   19k mfn   5 sept. 15:51  -- dependencies.yaml
drwxrwxr-x     - mfn  29 août  10:00  -- deployment
.rw-rw-r--  4,8k mfn  29 août  10:00  -- deployment.md
drwxrwxr-x     - mfn  29 août  10:00  -- docker-example
drwxrwxr-x     - mfn  29 août  10:00  -- docs
drwxrwxr-x     - mfn  29 août  10:00  -- graphdb
drwxrwxr-x     - mfn  29 août  10:00  -- infra
drwxrwxr-x     - mfn  29 août  10:00  -- job-management-services
drwxrwxr-x     - mfn  29 août  10:00  -- lib
drwxrwxr-x     - mfn  29 août  10:00  -- mocks
drwxrwxr-x     - mfn  29 août  10:00  -- plugin-services
.rw-rw-r--  1,5k mfn  29 août  10:00  -- README.md
.rw-rw-r--  2,9k mfn  29 août  10:00  -- sonar-project.properties
drwxrwxr-x     - mfn  12 sept. 15:03  -- src
drwxrwxr-x     - mfn  12 sept. 15:03  -- tools
drwxrwxr-x     - mfn  29 août  10:00  -- types
drwxrwxr-x     - mfn  29 août  10:00  -- user-mapping-services
drwxrwxr-x     - mfn  29 août  10:00  -- virtual-platform
.rw-rw-r--  6,0k mfn   5 sept. 15:51  -- WORKSPACE

This looks like a ubuntu specific error as I also uses eza on arch and it works, never previously worked on exa ubuntu.

ghost commented 1 year ago

From my testing it appears eza regards symbolic links as ignored if and only if they link to paths that match .gitignore.

Git on the other hand regards symbolic links as ignored if and only if they themselves match .gitignore.

This is on Linux Mint 21.2 (based on Ubuntu).

$ cat ../.gitignore
*.foo
bar.*
foo.baz
baz.bar
zzz.zzz
$ eza -l --git
.rw-rw-r-- 0 rsholmes 13 Sep 09:33 -I bar.x
lrwxrwxrwx 0 rsholmes 13 Sep 09:35 N- bar.y -> x.x
lrwxrwxrwx 0 rsholmes 13 Sep 09:34 -I bar.z -> bar.x
lrwxrwxrwx 0 rsholmes 13 Sep 09:34 -I baz.bar -> foo.baz
.rw-rw-r-- 0 rsholmes 13 Sep 09:33 -I foo.baz
.rw-rw-r-- 0 rsholmes 13 Sep 09:33 -I x.foo
.rw-rw-r-- 0 rsholmes 13 Sep 09:35 N- x.x
lrwxrwxrwx 0 rsholmes 13 Sep 09:36 N- y.foo -> x.x
lrwxrwxrwx 0 rsholmes 13 Sep 09:46 -I y.y -> foo.baz
lrwxrwxrwx 0 rsholmes 13 Sep 09:33 -I z.foo -> x.foo
lrwxrwxrwx 0 rsholmes 13 Sep 09:38 N- zzz.zzz -> x.x
$ git status
On branch main
Your branch is up to date with 'origin/main'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
    new file:   x.x
    new file:   y.y

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   ../.gitignore
github-actions[bot] commented 11 months ago

This issue is stale because it has been open for 30 days with no activity.