Hello,

There is currently an issue with the auto-completion included with yadm (a dot 
file manager). Yadm works by using a git repo to manage your dot files. It has 
some of it’s own commands (yadm bootstrap, for example) but the majority of the 
functionality is essentially a wrapper around the git command.

Yadm includes fish auto-completion, which you can see here: 
https://github.com/TheLocehiliosan/yadm/blob/0a5e7aa353621bd28a289a50c0f0d61462b18c76/completion/fish/yadm.fish

As you can see, it’s pretty simple, but there is currently an issue with the 
yadm add commands auto-completion taking an extremely long time.

The problem stems from the yadm add auto-completion coming from this line of 
the yadm.fish file:

complete -c yadm -w "git --git-dir=$GIT_DIR"

The GIT_DIR path will point to a git repo which acts at the root of the current 
users home folder. This means that when the wrapped git add completion runs it 
tries to get a list of all untracked files in the home folder, which is 
massive. This is the part of the git completions which is causing issues:

https://github.com/fish-shell/fish-shell/blob/80133c4bc65b33ac27ede72c929eeb9a8e64a9f0/share/completions/git.fish#L102-L511

The same problem happened with zsh completions in yadm. The fix for that was to 
override the behaviour of just the yadm add command to be more specific for 
yadm, but leave all the other completions as a wrapper around git.

@joshzcold has tried to do the same for fish, but it doesn’t seem like it’s 
possible to use the complete -w to wrap a command, but also override some of 
them. The wrapper seems to always overwrite the ones you provide:

https://github.com/TheLocehiliosan/yadm/issues/359#issuecomment-1961633980

Are we correct that this isn’t possible, or is there a clean way to say that 
yadm wraps git but also provides its own completions for certain commands?

Thanks,
Matt
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to