Welcome to the 78th edition of Git Rev News, a digest of all things Git. For our goals, the archives, the way we work, and how to contribute or to subscribe, see the Git Rev News page on git.github.io.
This edition covers what happened during the month of July 2021.
Bug report: GIT_CONFIG and user.email/name
German Lashevich sent a bug report about an issue when using the
GIT_CONFIG
environment variable.
He gave an example where he sets the user.name
and user.email
config variables to some values in a temporary
/tmp/git-test/.gitconfig
config file, and then sets GIT_CONFIG
to point to this file.
When he then tried to commit some changes, Git errored out with an
“Author identity unknown” error and instructions about how to set
the current account’s default identity. He expected that the values
of the user.name
and user.email
variables set in the temporary
config file would have been taken into account.
Peff, alias Jeff King, replied that GIT_CONFIG
is a historical
wart that isn’t used by all of Git, but only the git config
command, and even there git config --file
should be used instead.
He suggested using GIT_CONFIG_GLOBAL
or GIT_CONFIG_SYSTEM
which
are available since v2.32.0. They instruct Git to read a specific
file instead of the usual global (usually /etc/gitconfig
) or
system-level ($HOME/.gitconfig
and $XDG_CONFIG_HOME/git/config
)
config files respectively.
German thanked Peff saying GIT_CONFIG_GLOBAL
was what he needed.
Junio Hamano, the Git maintainer, replied to Peff that reading the
GIT_CONFIG
documentation gave a misleading impression as it
didn’t say that GIT_CONFIG
was only for the git config
command.
Peff agreed with Junio saying that the documentation hadn’t been
updated since 2007, when GIT_CONFIG
really did impact other
commands, and that he was sending
a small patch series
to improve the situation.
Taylor Blau and Martin Ågren reviewed the patches and discussed them a bit with Peff and Junio.
The patch series was later merged into the master branch, and the documentation improvements are now available in the recently released Git 2.33.
Various
Light reading
git switch
and git restore
appeared in Git 2.23 in 2019).Git tools and sites
CITATION.cff
files,
which use Citation File Format (CFF), are plain text files with
human- and machine-readable citation information for software (and datasets).
Code developers can include them in their repositories to let others know
how to correctly cite their software. Supported by GitHub, Zenodo and Zotero.
This edition of Git Rev News was curated by Christian Couder <christian.couder@gmail.com>, Jakub Narębski <jnareb@gmail.com>, Markus Jansen <mja@jansen-preisler.de> and Kaartic Sivaraam <kaartic.sivaraam@gmail.com> with help from Elijah Newren and Philip Oakley.