-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
git diff: filter file completion to paths containing changes #2115
Comments
The git completer was build over years, so it's no surprise there are some inconsistencies. I'm all for improving consistency and only completing changed files when others aren't appropriate. Still quite fond of the |
I've been meaning to add a config option for a while so things like this could be set to personal preferences. |
Thank you for your comments. I know Git has a huge surface that evolves with each release, and I'm uneasy because I'm not always sure of how I'd want Carapace to deal with it, and I know even less what would be suitable for everyone else. I'm mostly comparing to what I'm used to. To clarify my position:
|
Same, I'm limited to my own workflow so I don't encounter some edge cases. The last decision I had made here was that when the amount of values is
Always using splitted paths for |
@mytskine Updated positional completion for |
Request
git diff -- <TAB>
will suggest all the files in the current directory. Other completion systems filter this list so that only relevant files appear in the suggestions.Same for
git diff ./<TAB>
.Would also be great if
git diff mydirec<TAB>
would work like this.Proposed solution
I have a branch where
git diff --
works as I'm used to, i.e. completes one level of path at a time, ignoring the unchanged files and directories.master...mytskine:carapace-bin:git-diff-cached
It still lacks path normalization. For instance, having a prefix like
./
breaks completion.Anything else?
I tried to apply this the other file completion of git-diff, but the prefix makes it hard. I think it would require converting the partial value into a relative path, i.e. "./a" into "a" and "$(cwd)/a" into "a".
But I think it shows a bigger problem with carapace's completion of paths in git commands. I find it inconsistent, and that's the only thing preventing me from using this excellent tool. For instance, with a modified file inside the directory completers/ :
(edit: two use cases were swapped)
The text was updated successfully, but these errors were encountered: