extrawurst / gitui

Blazing 💥 fast terminal-ui for git written in rust 🦀
MIT License
18.18k stars 552 forks source link

[BUG]: Does not support custom git config path via GIT_CONFIG_GLOBAL #2298

Closed utilyre closed 1 month ago

utilyre commented 1 month ago

Describe the bug I tried to commit some changes and got the following error

commit error:
git error:config value 'user.name' was not found; class=Config (7); code=NotFound (-3)

It turns out it cannot find user.name or any other config because I have my git configuration in a different path from ~/.gitconfig, which I achieved by setting GIT_CONFIG_GLOBAL to ~/.config/git/config.ini.

To Reproduce Steps to reproduce the behavior:

  1. export GIT_CONFIG_GLOBAL=~/.config/git/config.ini (or any other location)
  2. Go to a git repository and make some changes
  3. Commit through gitui
  4. See error

Expected behavior It should check for this environment variable and use it if set. Also there is another environment variable that is related: GIT_CONFIG_SYSTEM.

Workaround

ln -s $GIT_CONFIG_GLOBAL ~/.gitconfig

Context (please complete the following information):

extrawurst commented 1 month ago

That is interesting. upstream supports this since last year: https://github.com/libgit2/libgit2/pull/6544

extrawurst commented 1 month ago

@utilyre if you have any chance to build from #2299 it would be great to test if this fixes your problem

koffydrop commented 1 month ago

@extrawurst i was having the same problem and the build from #2299 did fix it

extrawurst commented 1 month ago

2299 is merged now and a new nightly build triggered