mirror of
https://github.com/zed-industries/zed.git
synced 2026-07-10 00:13:29 +00:00
This is an unsolicited contribution, I hope that's ok. The feature is small and I didn't want to open a discussion just for this. There was no way to write to `.git/info/exclude` from Zed, so I added one. The "Add to .gitignore" action in the project panel and git panel context menus is now grouped under a "Git" submenu, with a new "Add to .git/info/exclude" action next to it. Both actions: - skip the write if the pattern is already there - make sure there's a trailing newline - show an error toast if something goes wrong - fail gracefully on remote repositories In the git panel both entries are disabled unless the file is untracked, same as the gitignore action was before. The write logic is shared via a small private helper, covered by two unit tests. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Added `Add to .git/info/exclude` option under a new `Git` submenu in the project panel and git panel context menus, alongside the existing `Add to .gitignore` action. --------- Co-authored-by: Cole Miller <cole@zed.dev> |
||
|---|---|---|
| .. | ||
| src | ||
| test_data | ||
| Cargo.toml | ||
| clippy.toml | ||
| LICENSE-GPL | ||