microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.62k stars 28.67k forks source link

Search excluded files: VS reads .gitignore contents as case sensitive, but Git reads it as case insensitive #151516

Closed happycollision closed 2 years ago

happycollision commented 2 years ago

Issue Type: Bug

  1. create a .gitignore like the following
    # Ignore everything
    *
    # Don't ignore readme files
    !readme.md
  2. Create a README.md file (be sure it is all caps) containing:
    You can't see me.
  3. Close the file (VS Code searches open files no matter what)
  4. Use VS Code's file search feature to find see me.

Expected

The file is found.

Actual

The file is not found.

My hypothesis: Git interprets .gitignore files as case insensitive, while VS Code reads the file as case sensitive. You can test this by changing the .gitignore to un-ignore README.md instead of readme.md and see that the search now finds the file. But in all cases, Git sees the file as available for version control.

The title of this issue implies my hypothesis, but perhaps there is a deeper issue where this only happens when you un-ignore a file using !.

VS Code version: Code 1.67.2 (c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5, 2022-05-17T18:20:04.972Z) OS version: Darwin arm64 21.5.0 Restricted Mode: No

System Info |Item|Value| |---|---| |CPUs|Apple M1 (8 x 24)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled| |Load (avg)|2, 2, 1| |Memory (System)|16.00GB (0.17GB free)| |Process Argv|--crash-reporter-id 425e08b4-fc4b-4cb8-8a7e-15c095b677ad| |Screen Reader|no| |VM|0%|
Extensions (45) Extension|Author (truncated)|Version ---|---|--- astro-vscode|ast|0.19.2 vscode-database|baj|2.2.3 openmatchingfiles|bca|0.5.2 shell-syntax|bma|1.0.3 vscode-tailwindcss|bra|0.8.6 better-toml|bun|0.3.2 vscode-eslint|dba|2.2.2 gitlens|eam|12.0.7 vscode-ember|emb|0.2.1 json-tools|eri|1.0.2 prettier-vscode|esb|9.5.0 vscode-open-multiple-files|fab|1.4.0 vscode-search-open-all-results|fab|1.0.3 html-slim-scss-css-class-completion|gen|1.7.8 todo-tree|Gru|0.0.215 beautify|Hoo|1.5.0 elixirlinter|iam|0.4.1 elixir-ls|Jak|0.9.0 ember-related-files|jos|1.5.0 minifyall|jos|2.10.0 mdhelper|jos|0.0.11 vscode-styled-components|jpo|1.7.0 Kotlin|mat|1.7.1 rainbow-csv|mec|2.4.0 vscode-docker|ms-|1.22.0 remote-containers|ms-|0.234.0 atom-keybindings|ms-|3.0.9 vsliveshare|ms-|1.0.5615 vsliveshare-audio|ms-|0.1.91 vsliveshare-pack|ms-|0.4.0 language-liquid|nei|0.1.1 advanced-new-file|pat|1.2.2 EmberES6Snippets|pha|2.3.3 phoenix|pho|0.1.1 ruby|reb|0.28.1 postcss|ric|2.0.0 partial-diff|ryu|1.4.3 mdx|sil|0.1.0 svg-preview|Sim|2.8.3 rewrap|stk|1.16.3 code-spell-checker|str|2.2.1 svelte-vscode|sve|105.17.0 vscode-status-bar-format-toggle|tom|3.0.0 vscode-ruby|win|0.28.0 change-case|wma|1.0.0
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 pythonvspyl392:30443607 pythontb:30283811 pythonvspyt551:30345470 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscoreces:30445986 pythondataviewer:30285071 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 vsc1dst:30438360 pythonvs932:30410667 wslgetstarted:30449410 vscscmwlcmt:30465135 cppdebug:30492333 vsclangdf:30486550 ```
happycollision commented 2 years ago

Closing in favor of reporting via insiders build...