Include untracked files in copilot-chat--git-ls-files#231
Merged
chep merged 2 commits intochep:masterfrom Jan 23, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances copilot-chat--git-ls-files to include untracked files when adding workspace files to a Copilot Chat context. Previously, only tracked files were returned; now both tracked and untracked (but not ignored) files are included.
Changes:
- Updated
git ls-filescommand to include--cached,--others, and--exclude-standardflags to return both tracked and untracked files while respecting gitignore patterns
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ncaq
previously approved these changes
Jan 21, 2026
Collaborator
|
@ajdin84 |
ncaq
approved these changes
Jan 21, 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.
I'll preface this by saying that I don't know what the intended behavior for this situation is - the change was useful for my use case, so I would like to merge it in case others would find it useful.
When calling
copilot-chat-add-workspace, in the case that the working directory/workspace for that chat instance is a git repo,copilot-chat--git-ls-filesis invoked to get the list of files to be added to the context list.copilot-chat.el/copilot-chat-command.el
Line 876 in 9dd4b0c
However, this doesn't include untracked files so I added additional arguments to make sure they get included.
As per the
git ls-files --helpmanpage: