Skip to content

Fix .git/info/exclude patterns matching against wrong root - #51708

Closed
mdippery wants to merge 1 commit into
zed-industries:mainfrom
mdippery:bug/git-info-exclude-ignore
Closed

Fix .git/info/exclude patterns matching against wrong root#51708
mdippery wants to merge 1 commit into
zed-industries:mainfrom
mdippery:bug/git-info-exclude-ignore

Conversation

@mdippery

@mdippery mdippery commented Mar 16, 2026

Copy link
Copy Markdown

Entries in .git/info/exclude were not being properly shown as ignored files in the project panel. This was due to the fact that build_gitignore was matching against the wrong root when loading entries from .git/info/exclude: it was using .git/info as the root, but the patterns in that file are relative to the repository root. Entries in .git/info/exclude will now be relative to the repository root, and those entries will be shown as ignored in the project panel.

Before you mark this PR as ready for review, make sure that you have:

  • Added a solid test coverage and/or screenshots from doing manual testing
  • Done a self-review taking into account security and performance aspects
  • Aligned any UI changes with the UI checklist

Release Notes:

  • Fixed a bug in which entries in .git/info/exclude where not properly marked as ignored in the project panel.

@cla-bot

cla-bot Bot commented Mar 16, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @mdippery on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Mar 16, 2026
@mdippery

Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Mar 16, 2026
@cla-bot

cla-bot Bot commented Mar 16, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@mdippery
mdippery force-pushed the bug/git-info-exclude-ignore branch 2 times, most recently from 8f40a31 to 3833238 Compare March 17, 2026 00:46
@mdippery
mdippery force-pushed the bug/git-info-exclude-ignore branch from 3833238 to c63a31b Compare March 17, 2026 20:41
@cole-miller

Copy link
Copy Markdown
Member

Thanks!

@cole-miller
cole-miller enabled auto-merge (squash) March 19, 2026 14:28
auto-merge was automatically disabled March 19, 2026 17:47

Head branch was pushed to by a user without write access

@mdippery
mdippery force-pushed the bug/git-info-exclude-ignore branch from c63a31b to 3c3aad3 Compare March 19, 2026 17:47
@mdippery

Copy link
Copy Markdown
Author

Fixed formatting issues.

@mdippery
mdippery force-pushed the bug/git-info-exclude-ignore branch from 3c3aad3 to 82ca40a Compare March 27, 2026 16:30
Entries in `.git/info/exclude` were not being properly shown as ignored
files in the project panel. This was due to the fact that
`build_gitignore` was matching against the wrong root when loading
entries from `.git/info/exclude`: it was using `.git/info` as the root,
but the patterns in that file are relative to the repository root.
Entries in `.git/info/exclude` will now be relative to the repository
root, and those entries will be shown as ignored in the project panel.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mdippery
mdippery force-pushed the bug/git-info-exclude-ignore branch from 82ca40a to 77d76b0 Compare April 8, 2026 18:43
@cole-miller

Copy link
Copy Markdown
Member

Thanks--without realizing it I merged a different fix PR (#57779) for the same issue; sorry for not following up and letting this become stale.

@cole-miller cole-miller closed this Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants