Load the repository from $GIT_DIR when it is set
most git commands use the repository at
$GIT_DIR when this environment variable is set: https://git-scm.com/docs/git#git-codeGITDIRcode
Maybe gitg could honor this too.
Admittedly this is not a big shortcoming as the user could always call
gitg "$GIT_DIR", however behaving like other git commands may spare the initial surprise and save the user some time.
I noticed the issue when working with detached bare repositories, like those set up by vcsh: https://github.com/RichiH/vcsh
If you use vcsh you can reproduce the issue by running:
vcsh enter <reponame> gitg