Run git command with certain environment variables
sassanh opened this issue · comments
Is your feature request related to a problem? Please describe.
The problem is one may like to have different environment variables for git in different projects. For example to set different GIT_AUTHOR_EMAIL
for work projects and personal projects. I know this particular environment variable can be set by git config
, but there are variables that can't be set by git config
or one may want to be able to implement an automation to set GIT_AUTHOR_EMAIL
not per repository, but based on other conditions.
Describe the solution you'd like
To solve this issue generally for most cases, it would be nice if we had these options to config the execution of git command in neogit:
- Set environment variables for git for one particular action, in
neogit.action
parameters. - Set environment variables for git for one particular neogit session, in
neogit.open
parameters. - Set environment variables for git generally for all neogit actions and sessions, in
neogit.setup
parameters. - Set custom executable for git for one particular action, in
neogit.action
parameters. - Set custom executable for git for one particular neogit session, in
neogit.open
parameters. - Set custom executable for git generally for all neogit actions and sessions, in
neogit.setup
parameters.
Examples:
neogit.action('commit', 'commit', {'--verbose'}, {env_vars = {GIT_AUTHOR_EMAIL = 'someemail@somedomain.com'}})
neogit.open({git_executable = '/usr/bin/custom_git'})
neogit.setup({git_execttable = '~/bin/my_fancy_git', env_vars = {HOME = '/home/x/'}})