-
Notifications
You must be signed in to change notification settings - Fork 276
gptel-context: Allow exclusion of gitignored files #665
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
base: master
Are you sure you want to change the base?
Conversation
(I just noticed that I forgot to set the default value of |
I would set it to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I've got one performance concern and one behavior suggestion.
Could you move all the git-related functions Additionally, anywhere you run a file-name function like |
It might be worth using |
…ames * Calling files not matching patterns in .gitignore ‘git-tracked’ was confusing because, in git terminology, ‘tracked’ has a technical meaning. So we now use ‘git-unignored’ instead, which more clearly conveys the idea of files not git-ignored.
I thought calling this function ‘gptel-context--is-git-ignored-p’ would make its purpose clear, but I now realize this is a misnomer: the value returned depends also on the user option gptel-context-exclude-git-ignored, so the function may return nil even when the file is git-ignored.
c37877d
to
e02f44e
Compare
@karthink, I believe I have now addressed all your requested changes. Let me know if you have further comments. |
Late to the party here (and I wouldn't want to derail this feature; I was recently bitten by it), but was the use of |
Hi @vermiculus. I didn’t consider using |
@vermiculus: I revised the PR to make it use It would be great if folks could test this before it is merged: I’m not a programmer and my eyes may fail to catch problems. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took a pass here, though I'm just on my phone so sorry for formatting.
How does this perform functionally for you? Any noticeable delay with larger/smaller projects with more/fewer ignored build artifacts?
I see some whitespace changes that apparently just change spaces to TABs, most likely since emacs has |
a6faa40
to
b83fbcd
Compare
b83fbcd
to
c197a74
Compare
I think I'm basically done with the changes here. My only concern is that If and when @karthink agrees to merge this PR, I'm happy to do some squashing to clean up the commit history. |
(If the performance issue is not addressed, I am now inclined to set the default value of |
Hi @karthink, and great work @benthamite on this PR! This feature is excellent! For me, it addresses a pressing need, as it was the first thing I looked for when I started adding projects to the context. @karthink, is there an estimated timeline for merging this? I'd be happy to contribute by implementing the hash-table optimisation that was discussed, if that would help move this PR forward towards main. |
I've just been busy with other features (and the new release) is all. I had some performance concerns about this PR, but they might be fixed now. I need to check. Is adding entire projects to the context even viable? It seems like a lot, not to mention inefficient. Maybe I'm just behind in my thinking, context windows have been increasing recently. |
FWIW, I do agree it’s generally inefficient. My workflow for integrating AI with projects has changed since submitting this PR, and now I almost always add selected project files rather than all files in a project. Still, I guess that if one wants to do the latter, one typically wants to exclude gitignored files, so I think this is probably still a useful feature to have (modulo the performance concerns, which I agree are valid). |
Agreed, excluding the |
Continuing the discussion here, this PR allows the user to exclude, by setting the user option
gptel-context-exclude-gitignored
tot
, gitignored files or directories from the context.Tagging participants in previous discussion: @hartikainen, @collinarnett, @metachip, @sandinmyjoints.