Let's say we are setting up new system using versioned dotfiles. Fisher is not installed yet but is listed at the beginning of the versioned fish_plugins file. There are other plugins after it. If we call
curl -sL git.io/fisher | source && fisher update
fisher changes fish_plugins unnecessary by moving it's entry to the end.
@hajdamak You want Fisher to be the first entry in the file?
@jorgebucaran I just don't want fisher to change config file unnecessary. Fisher seems logical as the first item on the list though.
@hajdamak I wasn't able to reproduce this. What's in your fish_plugins file?
@jorgebucaran
jorgebucaran/fisher
franciscolourenco/done
@hajdamak Still can't reproduce. Are you using the latest Fisher? Anything else you can share with me?
$ printf "%s\n" jorgebucaran/fisher franciscolourenco/done >~/.config/fish/fish_plugins
$ cat ~/.config/fish/fish_plugins
jorgebucaran/fisher
franciscolourenco/done
$ fisher
fish: Unknown command: fisher
$ curl -sL git.io/fisher | source && fisher update
fisher update version 4.1.0
fetching https://codeload.github.com/jorgebucaran/fisher/tar.gz/HEAD
fetching https://codeload.github.com/franciscolourenco/done/tar.gz/HEAD
installing jorgebucaran/fisher
/Users/jb/.config/fish/functions/fisher.fish
/Users/jb/.config/fish/completions/fisher.fish
installing franciscolourenco/done
/Users/jb/.config/fish/conf.d/done.fish
installed 2 plugin/s
$ fisher list
jorgebucaran/fisher
franciscolourenco/done
$ cat ~/.config/fish/fish_plugins
jorgebucaran/fisher
franciscolourenco/done
Very strange, I was able to reproduce it many times on two machines. No I have removed fish_variables and problem is gone.
@hajdamak Were you using 4.0? In 4.0 we would query plugins in $fisher_data using a glob. This would have returned the list of plugins in alphabetical order.
In 4.1, we use UVARS to save Fisher's state instead, so the original install order should be preserved when we print the variable into fish_plugins.
I was using previous version, not sure which one. But problem apeared on 4.1 and kept happening until I have removed vars file.
If plugin is added/removed all plugins are not reordered but rather plugin is removed from the list or added somewhere (end?). Right?
Thank you for your help.
Yes, only that plugin.
Am also facing this problem when trying to synchronise my dotfiles across machines. Was there any resolution?
@seowalex I'm not sure this is a problem anymore. Can you describe your issue?
I believe it has to do with fisher trying to preserve the original install order, but when I run fisher update on a different machine using a version-controlled fish_plugins, the plugins are reordered afterwards.
Unfortunately, that's not enough information for me to act on anything. Fisher will not reorder plugins in any particular way when you run . It will read your fisher updatefish_plugins and update/reinstall plugins in the same order as they appear in the file.
Actually, the order does change back to the original installing order. See explanation below.
If I manually reorder the plugins in my fish_plugins file, will fisher update change the order of the plugins?
Yes. I see what's happening here. Fisher will reorder plugins in fish_plugins according to the original install order as that's how they're listed in the $_fisher_plugins variable. I can look into changing this, but could you explain why is that an issue?
Well, it's not so much an issue as it is an inconvenience. I just happened to synchronise my fish_plugins file across different machines after they had been set up.
@seowalex Could you explain what the inconvenience is? I need a user story in order to act here.
Before, I manually installed my plugins for each specific machine, so each machine has the plugins in a different order. Recently, I decided to move my fish_plugins file to my dotfiles repo, and found that the order is inconsistent across machines after doing fisher update, even when I have the same plugins installed.
That's a great description of the issue, but it doesn't really tell me what the inconvenience is.
Does order matter? How did you notice the order changed to start with?
Ah perhaps I was unclear. The inconvenience happens when I run fisher update, which dirties my directory, since my fish_plugins is symlinked to the correct directory.
I thought we were discussing plugin order in fish_plugins. What are you talking about? Sorry, but do you realize that you're not being helpful? If you're interested in fixing this, I'm going to need more details.
@hajdamak I was able to identify this issue as Fisher preserving the original fisher install order during subsequent updates, instead of the order specified in fish_plugins. I still don't understand @seowalex's issue exactly.
Here's what was happening before:
$ fisher install a b c
$ fisher list
a
b
c
$ cat > $__fish_config_dir/fish_plugins
c
b
a
^D
$ fisher update && fisher list
a
b
c
Fisher will now preserve the order specified in your fish_plugins instead, which is the same as the original fisher install order unless you happen to change it. If you change it, Fisher won't change it back.
Apologies for being unhelpful, but that looks like it solves my problem! If I can be of any further assistance, I'm happy to help.