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

forgit-git not found when trying to use forgit on fish when installed via the AUR #270

Closed
5 of 10 tasks
sandr01d opened this issue Jan 1, 2023 · 3 comments · Fixed by #272
Closed
5 of 10 tasks

Comments

@sandr01d
Copy link
Collaborator

sandr01d commented Jan 1, 2023

Check list

  • I have read through the README
  • I have the latest version of forgit
  • I have searched through the existing issues

Environment info

  • OS
    • Linux
    • Mac OS X
    • Windows
    • Others:
  • Shell
    • bash
    • zsh
    • fish

Problem / Steps to reproduce

I tried reproducing #267 and found a similar (but I think different) issue with forgit on fish when installed via the forgit-git package in the AUR. When trying to run any forgit command in fish, I get an error like this:

fish: Unknown command: /usr/share/fish/conf.d/bin/git-forgit
/usr/share/fish/vendor_conf.d/forgit.plugin.fish (line 34): 
    "$FORGIT" add $argv
    ^
in function 'forgit::add'
        called on line 1 of file -
in function 'ga'

The reason for this is, that the PKGBUILD installs the forgit fish wrapper in usr/share/fish/vendor_conf.d/ and also symlinks git-forgit there with:

# fish install
install -Dvm644 conf.d/forgit.plugin.fish -t "$pkgdir/usr/share/fish/vendor_conf.d/"
install -dv "$pkgdir/usr/share/fish/vendor_conf.d/bin/"
ln -sv /usr/bin/git-forgit "$pkgdir/usr/share/fish/vendor_conf.d/bin/"

But we expect forgit-git in usr/share/fish/conf.d/bin/ here:

set FORGIT "$INSTALL_DIR/conf.d/bin/git-forgit"

Is the different directory name (conf.d/vendor_conf.d) a difference between macOS and Linux? When modifying the PKGBUILD, so that everything gets installed in conf.d instead, forgit does not become automatically available in fish.
I am completely new to fish and don't know what the solution should be here. Maybe @cjappl knows more about this?

@cjappl
Copy link
Collaborator

cjappl commented Jan 7, 2023

Hmm. Good question.

So I wasn't the original one who wrote moved the script to conf.d. I'm not at my computer right now, but if you look back through the history, another contributor did that.

I think if we find that person we can ask them, they have a much better handle on fish packages than myself (I use "plain" fish, and don't fully understand the plugin infra)

@sandr01d
Copy link
Collaborator Author

sandr01d commented Jan 7, 2023

Hey @folliehiyuki, since you're the one that moved forgit.plugin.fish to conf.d in #117 / #119, would you mind taking a look at this? The corresponding issue is #116 in case anybody is looking for it. Is having the script in conf.d a requirement for fish plugin managers or could it also be moved to vendor_conf.d?
@cjappl you're on macOS, right? Would you mind testing whether your setup works when the directory is renamed to vendor_conf.d? I think the only things that have to be done is renaming the directory and modifying this line accordingly:

set FORGIT "$INSTALL_DIR/conf.d/bin/git-forgit"

@carlfriedrich
Copy link
Collaborator

For fisher the plugin definitely has to be in conf.d, otherwise it won't be installed:

https://github.com/jorgebucaran/fisher#creating-a-plugin

fish however reads plugin files from both directories:

https://fishshell.com/docs/3.3/index.html#configuration-files

So I think, we should leave the file in conf.d within the repository, but check for both paths from within the code.

cjappl pushed a commit that referenced this issue Jan 10, 2023
…onf.d (#272)

In the fish wrapper, assume forgit-git to be in vendor_conf.d/bin in case it can not be found in conf.d/bin. This fixes forgit not working with fish when located in /usr/share/fish/vendor_conf.d, as is the case with the forgit and forgit-git AUR packages. The location at conf.d is kept (and stays the default), so forgit does not break compatibility with fish plugin managers, such as fisher.

Closes #270
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants