Skip to content
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

Allow fish_update_completions to skip already generated files #6775

Closed
JanczarKurek opened this issue Mar 19, 2020 · 4 comments
Closed

Allow fish_update_completions to skip already generated files #6775

JanczarKurek opened this issue Mar 19, 2020 · 4 comments

Comments

@JanczarKurek
Copy link
Contributor

Hi

I was making some hooks to pacman to regenerate fish completions upon installing/updating packages. Regenerating all completions each time can be pointless, and in most cases we're interested in generating only few completions.

This can be done by getting this info from package manager and manually choose files to fish_update_completions. It is unfortunately distro-dependent and maybe needs some logic already existing in code (mapping manpage names into completion names for example).

My proposal is to implement this as an optional flag into script - for example by checking mod times of manpages and completions. I am willing to implement this change if accepted.

@zanchey zanchey added this to the fish-future milestone Mar 20, 2020
@zanchey
Copy link
Member

zanchey commented Mar 20, 2020

SGTM! One thing to think about is if the path is different (eg first completion generated from /usr/share/man/man1/foo.1, when regenerated it is picked up from /usr/local/share/man/man1/foo.1 instead).

@faho
Copy link
Member

faho commented Mar 20, 2020

I would assume you'd get most of the bang for quite a bit less effort if you just passed the paths of all the changed manpages?

If I e.g. update coreutils, just passing all the files that touched in /usr/share/man/man1/ (figuring that path out left as an exercise to the reader), like /usr/share/man/man1/ls.1.gz, should allow us to skip most other manpages and allow most of the speed up.

@JanczarKurek
Copy link
Contributor Author

I agree this is possible to achieve outside python script, but e.g. that path figuring part is already done in script (and takes some lines to be as broad as possible).

@JanczarKurek
Copy link
Contributor Author

Ok, first of all - script always removes all existing completions from destination directory, and thats not a nice thing when it comes to regenerating. Imho cleanup in target directory should be at least non mandatory, especially that we already have --cleanup-in flag that can do the same thing. What do you think?

@zanchey zanchey linked a pull request Apr 11, 2020 that will close this issue
@zanchey zanchey modified the milestones: fish-future, fish 3.2.0 Apr 11, 2020
@zanchey zanchey closed this as completed Apr 11, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants