Add "Add to .gitignore" action in project_panel#47377
Merged
ChristopherBiscardi merged 5 commits intozed-industries:mainfrom Apr 23, 2026
Merged
Add "Add to .gitignore" action in project_panel#47377ChristopherBiscardi merged 5 commits intozed-industries:mainfrom
ChristopherBiscardi merged 5 commits intozed-industries:mainfrom
Conversation
Member
|
Thanks! Could we extract the code to add a path to |
Contributor
Author
|
Yes, done! I also made it work for directories as well (was just files). |
Contributor
Author
|
Hey @cole-miller, just checking in on the changes I made addressing your feedback on Feb 2. Let me know if there's anything else needed! |
ChristopherBiscardi
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR adds a "Add to .gitignore" action to the project panel's right-click context menu. Similar to the "Restore File" action that I previously added, I frequently find myself wanting this in the project panel.
With the restore file option:

Notes:
Implementation: The
add_to_gitignorefunction is essentially copy-pasted fromgit_panel.rs.Error handling: Added toast notification on error, which is consistent with
restore_filein project_panel andperform_checkoutin git_panel.Note that
add_to_gitignorein git_panel does NOT show a toast (just usesdetach_and_log_err). I don't know if this is on purpose.To follow up, I can either: match the project_panel implementation to the git_panel one (no toast), or update the git_panel implementation to also show a toast on error.
Menu grouping: Previously "Restore File" and "View File History" were in separate sections, but both relate to git. With this third git action, I grouped all three together under a single separator (see screenshot).
We could also keep "View File History" separate and only group "Restore File" + "Add to .gitignore" together (both modify the working tree state in some way), if we don't want to alter the existing UI too much.
Release Notes: