git-team
git-team copied to clipboard
adding assignments fails if gitconfig can't be found or written to
Bug Report
git-team version: 1.7.0 go version: 1.17.7
failure description
Invoking git team assignments add noujz "Mr. Noujz <[email protected]>"
exits with error: exit status 255
if no $HOME/.gitconfig
is present.
This also happens if the file is read-only.
Background: It's possible to store gitconfig under $XDG_HOME, e.g. $HOME/.config/git/config Git checks a set of paths for configurations on every invocation.
expected behaviour description
Creation of $HOME/.gitignore or another distinct file for git-team. Alternatively or additionally a graceful exit with an explanation error message or offering to create a .gitconfig.
Note: Some approaches like home-manager favours immutable configuration, meaning that wherever gitconfig is put it is read-only by default. That's not always a given and it's possible to make them writeable as well.
PS:This also happens for other git-team cmd's that rely on the existence of the file like git-team disable
.
Finally had some spare time to implement a "fix" with revision https://github.com/hekmekk/git-team/commit/74119e2086097d14ec0420ad9fcb695308272478.
Decided for printing more helpful error messages for the time being as it feels right to me that git-team as a git sub command makes use of the git config
command for configuration and useful error messages have definitely been missing here.