Skip to content
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

Parent .gitignore files seem to not work the way git works #23565

Open
1 task done
brandonweiss opened this issue Jan 23, 2025 · 2 comments
Open
1 task done

Parent .gitignore files seem to not work the way git works #23565

brandonweiss opened this issue Jan 23, 2025 · 2 comments

Comments

@brandonweiss
Copy link

brandonweiss commented Jan 23, 2025

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

I think this must have changed recently because I don’t think this was an issue before… it seems like it cropped up in the last few weeks or months.

Basically I have a directory structure like this:

/Users/brandon/.gitignore
/Users/brandon/Developer/app/.gitignore
/Users/brandon/Developer/app/vendor/ruby

In my root .gitignore I include vendor/ruby. It’s not in the app .gitignore because this is more a vagary of how I install dependencies, and not something that everyone who works on the app does.

git properly ignores vendor/ruby by seeing the root .gitignore file. But zed shows vendor/ruby in the project panel. When I Go to File or do a project search vendor/ruby is also included in the results.

I found a few existing issues (like this one #21370 and this one #6998) which confuse me even more about this because it sounds like people want zed to not respect parent .gitignore files? Which seems to be different from how git itself works?

Steps to reproduce

I think this should do it:

cd ~/
touch .gitignore
echo "vendor/ruby" > .gitignore
mkdir app
cd app
git init
touch .gitignore
mkdir vendor
mkdir vendor/ruby
touch vendor/ruby/some-file

Running git status in ~/app should not show vendor/ruby/some-file because it has been ignored by the ~/.gitignore.

If you open ~/app in zed, zed shows vendor/ruby/some-file in the project panel in a bright color (not ignored) and CMD-P shows vendor/ruby/some-file in the list of files to open.

I would expect vendor/ruby/some-file to be greyed out in the project panel (indicating it is ignored) and CMD-P should not show vendor/ruby/some-file in the list of files to open.

Zed Version and System Specs

Zed: v0.169.3 (Zed)
OS: macOS 15.0.1
Memory: 36 GiB
Architecture: aarch64

If applicable, add screenshots or screencasts of the incorrect state / behavior

Image

If applicable, attach your Zed.log file to this issue.

Zed.log

@notpeter
Copy link
Member

Can you edit your description to provide (1) a concise set of explicit steps to reproduce (2) the current behavior of zed (3) your expected behavior?

@brandonweiss
Copy link
Author

@notpeter I added more to the description—is that what you’re looking for?

@JosephTLyons JosephTLyons removed bug [core label] admin read labels Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants