forgit
forgit copied to clipboard
git sub-command does not respect env variables in .zshrc
Check list
- [x] I have read through the README
- [x] I have the latest version of forgit
- [x] I have searched through the existing issues
Environment info
- OS
- [x] Linux
- [ ] Mac OS X
- [ ] Windows
- [ ] Others:
- Shell
- [ ] bash
- [x] zsh
- [ ] fish
Currently on commit 6385f85
Problem / Steps to reproduce
Setting values in in .zshrc file works alias (eg. glo), but not as git alias (eg. git forgit log).
For example, glo
works with the setting the following in .zshrc file
FORGIT_FZF_DEFAULT_OPTS="
--reverse
"
but git forgit log
does not respect the values and thus does not have the reverse flag applied.
FORGIT_FZF_DEFAULT_OPTS=" --reverse "
Hi @fadzlan, thanks for filing this report.
Due to the way the git forgit *
aliases work, you must use the export
keyword when setting environment variables for this to work properly. So, if you update your .zshrc
like so, you should be good to go:
export FORGIT_FZF_DEFAULT_OPTS="
--reverse
"
@wfxr This should probably be updated in README.md
. I was thinking of just adding export
to all of the examples of setting config in the file (this will make the config always work for both shell aliases and the git aliases).
I can send a PR later today if you're ok with this approach.
@wren Do you mean let the user set all the environment variables in .zshrc
?
It works! Thanks.
In the current documentation, there is already instruction to set up the environment variable, just not where should you set it.
I think it can remain that way, with just additional instruction to add export
if the current setting is not working for git forgit <command>
@wfxr Sorry for the slow reply; I missed this in my inbox.
I was asking whether it's ok to put export
in front of all of the examples in the readme. Users can continue to set variables wherever they are setting them now (like .zshrc
), but having export
there will make the vars work with both the traditional way to run forgit, and the git sub-command. So, since it works with both methods, it might be clearer for users if export
is there on all of the examples. Just an idea, though. I'm happy to approach it some other way if you prefer.
@wren Got it. I think it's OK!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.