dvc
dvc copied to clipboard
list: doesn't ignore gitignored files
Bug Report
Description
dvc list -R . . lists .env even if it is part of the .gitignore
It's related to https://github.com/iterative/dvc/issues/5712, and we should understand what do we expect. But it's a bug from the current implementation perpective.
Reproduce
mkdir test-list-gitignore
cd test-list-gitignore
git init
virtualenv -p python3 .env
source .env/bin/activate
pip install -e "../dvc[all]"
echo ".env" >> .gitignore
git add .gitignore
git commit ".gitignore" -m "update .gitignore"
dvc list -R . .
Returns:
...
.env/share/doc/networkx-2.5.1/examples/graph/__pycache__/plot_roget.cpython-38.pyc
.env/share/doc/networkx-2.5.1/examples/graph/__pycache__/plot_words.cpython-38.pyc
.env/share/doc/networkx-2.5.1/examples/graph/dot_atlas.py
.env/share/doc/networkx-2.5.1/examples/graph/plot_degree_sequence.py
.env/share/doc/networkx-2.5.1/examples/graph/plot_erdos_renyi.py
.env/share/doc/networkx-2.5.1/examples/graph/plot_expected_degree_sequence.py
.env/share/doc/networkx-2.5.1/examples/graph/plot_football.py
.env/share/doc/networkx-2.5.1/examples/graph/plot_karate_club.py
.env/share/doc/networkx-2.5.1/examples/graph/plot_napoleon_russian_campaign.py
.env/share/doc/networkx-2.5.1/examples/graph/plot_roget.py
.env/share/doc/networkx-2.5.1/examples/graph/plot_words.py
.env/share/doc/networkx-2.5.1/examples/graph/roget_dat.txt.gz
.env/share/doc/networkx-2.5.1/examples/graph/words_dat.txt.gz
.env/share/doc/networkx-2.5.1/examples/javascript/README.txt
.env/share/doc/networkx-2.5.1/examples/javascript/__pycache__/force.cpython-38.pyc
.env/share/doc/networkx-2.5.1/examples/javascript/force.py
...
Expected
Probably no .env (it's very inefficient) and probably breaks the current logic?
But it also should be specified as part of the https://github.com/iterative/dvc/issues/5712
Environment information
DVC version: 2.3.0+ed2a0b
---------------------------------
Platform: Python 3.8.9 on macOS-10.15.6-x86_64-i386-64bit
Supports: All remotes