Microsoft/vscode

explorer.excludeGitIgnore stops at the first .gitgnore file it finds instead of walking up the tree to the git repo root

Open

#189.951 aberto em 8 de ago. de 2023

Ver no GitHub
 (2 comments) (6 reactions) (1 assignee)TypeScript (10.221 forks)batch import
bugfile-explorerhelp wanted

Métricas do repositório

Stars
 (74.848 stars)
Métricas de merge de PR
 (Mesclagem média 11h 43m) (1.000 fundiu PRs em 30d)

Description

Type: Bug

Repro recipe:

mkdir vscode-gitignore && cd vscode-gitignore && git init && echo 'test-directory/' > .gitignore && mkdir .vscode && echo '{ "explorer.excludeGitIgnore": true }' > .vscode/settings.json && mkdir -p subdir/test-directory && touch subdir/.gitignore && cd subdir && git status &&  /Applications/Visual\ Studio\ Code.app/Contents/MacOS/Electron --disable-extensions .

Expected: test-directory is hidden from file explorer since it's missing from the git status output.

Observed: test-directory is present in the file explorer.

I believe this is happening because VSCode is finding & using subdir/.gitignore without consideration of the top-level .gitignore file in the parent directory. Since git ignore considers all .gitignore files in the repo between the destination and the root, IWBN for excludeGitIgnore to do the same.

(the practical effect of this is having to duplicate entries from the root .gitignore file into descendant .gitignore files to get VSCode to ignore them)

VS Code version: Code 1.81.0 (Universal) (6445d93c81ebe42c4cbd7a60712e0b17d9463e97, 2023-08-02T12:40:02.782Z) OS version: Darwin arm64 22.6.0 Modes:

Item Value
CPUs Apple M1 Pro (10 x 24)
GPU Status 2d_canvas: enabledcanvas_oop_rasterization: disabled_offdirect_rendering_display_compositor: disabled_off_okgpu_compositing: enabledmetal: disabled_offmultiple_raster_threads: enabled_onopengl: enabled_onrasterization: enabledraw_draw: disabled_off_okvideo_decode: enabledvideo_encode: enabledvulkan: disabled_offwebgl: enabledwebgl2: enabledwebgpu: enabled
Load (avg) 4, 3, 3
Memory (System) 32.00GB (1.01GB free)
Process Argv --crash-reporter-id 238d4d83-8b5b-4545-8c62-9914465be0f0
Screen Reader no
VM 0%
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
vsccc:30803844
3biah626:30602489
89544117:30613380
showlangstatbar:30737416
vsctsb:30748421
03d35959:30757346
pythonfmttext:30731395
pythoncmv:30756943
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
gsofa:30804715
pythonnosmt12:30797651
pythonidxpt:30805730
pythonnoceb:30805159
e537b577:30795824
dsvsc013:30795093
dsvsc014:30804076

Guia do colaborador