Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: git diff HEAD - only show modified files in completion



Hi Bart Schaefer,

Thank you very much.

Best Regards,

Ahmad Ismail



On Sun, Oct 18, 2020 at 4:15 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
On Sat, Oct 17, 2020 at 8:24 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> I was thinking there should be some way to implement this with a
> zstyle by changing the program invoked by _call_program

Finally had a chance to poke at this a bit more ...

On Sat, Oct 17, 2020 at 9:25 AM Ahmad Ismail <ismail783@xxxxxxxxx> wrote:
>
> I have asked this question on reddit afterwards.

In your post there, you said:

> I also tried zstyle :completion::complete:git-difftool:argument-rest:' command 'git ls-files -m'. Apparently it is doing nothing.

So very close.

zstyle ':completion::complete:git-diff*:argument-rest:tree-files'
command 'git ls-files -m'

One question is why ^Xh (list-tags) shows the "files" tag for that
context but not the "tree-files" tag.  If you invoke completion
immediately after "git diff " (instead of after "git diff HEAD ") then
the context is "changed-in-working-tree-files" and THAT gets shown
correctly by ^Xh.


Messages sorted by: Reverse Date, Date, Thread, Author