Initialize _fisher_plugins using fish_plugins file (#741)#746
Conversation
|
Bump for further consideration, @jorgebucaran. Thanks. |
|
I have been addressing and investigating issues all weekend, so I am taking a break for now. However, I wanted to let you know that I will certainly look into this matter soon and will incorporate this change (or a similar one, as I'm not certain this will be merged as is) before Fisher 5. This should occur in the not-too-distant future. 🙏 |
|
Is the issue described here possibly related to one I have? vv@my-precious ~/.config/fish/conf.d $ fisher install oh-my-fish/plugin-bang-bang
fisher install version 4.4.3
Fetching https://api.github.com/repos/oh-my-fish/plugin-bang-bang/tarball/HEAD
fisher: Invalid plugin name or host unavailable: "oh-my-fish/plugin-bang-bang"
vv@my-precious ~/.config/fish/conf.d $ ll |
|
I doubt it. It might be related to the curl or tar version or your OS. What's your OS, distro, and the curl and tar version you're using? Lines 101 to 106 in 59228d6 |
its latest macos with m1 chip vv@my-precious ~/work/own/careerpartner/src $ curl -V
curl 7.88.1 (x86_64-apple-darwin22.0) libcurl/7.88.1 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.11 nghttp2/1.51.0
Release-Date: 2023-02-20
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL threadsafe UnixSockets
vv@my-precious ~/work/own/careerpartner/src $ tar --version
bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8
vv@my-precious ~/work/own/careerpartner/src $ |
|
okay, I figured it out |
This change is for users who commit fish_plugins and plugin sources but
omit fish_variables. On a system where Fisher's universal variables are
unset, most Fisher commands were not working out-of-the-box:
* `fisher install <plugin>` - installs <plugin>, rewrites fish_plugins file with only <plugin>
- if <plugin> is in fish_plugins, same behavior as `fisher update`
* `fisher remove <plugin>` - fails with error: Plugin not installed "<plugin>"
* `fisher update <plugin>` - fails with error: Plugin not installed "<plugin>"
* `fisher update` - fails with error about conflicting files, deletes fish_plugins file
* `fisher list [<regex>]` - returns nothing
As of this commit all Fisher commands work except for `fisher remove`;
Fisher still has no way of knowing which files to remove absent the
universal variable that tracks the files associated to a plugin.
It may make sense to reject calls like `fisher remove <plugin>` if the
`_fisher_<plugin>_files` universal variable is missing. Fisher could
suggest the user run `fisher update` and try again.
|
@charego Sorry, but can you break down the main goal and reason for this PR again? Why's it a must-have? |
|
Essentially, how to use Fisher with dotfiles? Is there a best practice as you see it? The instructions are geared toward interactive use. I would like to bootstrap Fisher from dotfiles on a new machine without interactive use. |
Same here. I would like to use Fisher declaratively through Nix Home Manager. Haven't had any luck so far. |
|
Honestly, the reason I haven't been able to work on this is because I don't understand the aim at a fundamental level. Do you just want Fisher to fail silently if universal variables are not set? |
|
@jorgebucaran, from what I understand, the idea is to not use So our options are:
The reason we don't commit For example, mine contains a bunch of variables set by |
|
@jorgebucaran One more thing to consider before merging this, maybe we should commit Plugins should not store non-portable data in For reference: |
That sounds a lot like #611. Fisher preserves the '~' in paths when saving plugins to the universal state, making it safer to commit fish_variables. While it might not be perfect, it does prevent committing data that obviously varies across machines, such as different usernames or home directories. What else are we missing? |
Yes, but Z doesn't. And possibly other plugins too. OP's solution to this is to not commit My opinion is that, ideally we should ask Z and other problematic plugins to implement proper handling of |
|
Fish itself currently doesn't want you to share the fish_variables file across machines. For example, I share my dotfiles between two machines, one has fish 3.7.1 and one has fish 4.0.0. The first one has SETUVAR __fish_initialized:3400 and the second one has SETUVAR __fish_initialized:3800. There's even discussion about removing (default) uvars altogether, but that doesn't seem to be moving forwards quickly (fish-shell/fish-shell#7317 and fish-shell/fish-shell#7379). So we really need a way to sync plugins across machines without sharing fish_variables for the foreseeable future. |
|
Since 4.4.7, we've fixed one cause of fish_plugins becoming out of date during bootstrap via fisher install, which seems closely related to the main issue you were addressing here. I'm still monitoring other scenarios, but it would be helpful if you could check whether this situation is fixed for you now. |
This change is for users who commit fish_plugins and plugin sources but omit fish_variables.
On a system where Fisher's universal variables are unset, most Fisher commands do not work out-of-the-box:
fisher list [<regex>]fisher remove repo/pluginfisher update repo/pluginfisher updatefisher install repo/pluginfisher updateAs of this commit all Fisher commands work except for
fisher remove. Fisher still has no way of knowing which files to remove absent the universal variable that tracks the files associated to a plugin. It may make sense to reject calls likefisher remove repo/pluginif the_fisher_repo_2F_plugin_filesuniversal variable is missing. Fisher could suggest the user runfisher updateand try again.Note: I haven't really investigated how this works with local plugins since I don't use those.
Attempt to fix #741.