I've installed etckeeper & git on a new machine running arch. I've got sudo and git setup for my regular user. When I sudo etckeeper commit "Initial commit"
git gives me the usual message about empty ident name for root@host. Documentation suggests that sudo will grab the ident of sudo user but that doesn't seem to be working. I'm running etckeeper 1.18.12-1. What am I missing?
One possible solution to your issue would be to edit /etc/etckeeper/etckeeper.conf
and change the VCS variable value to include the location of your gitconfig file. Assuming yours is in the default location of ~/.gitconfig
that would mean changing it from VCS="git"
to VCS="git -f /home/<yourusername>/.gitconfig"
(be sure to use the canonical path to the file rather than relying on the ~
alias for your home directory because in this instance ~ points to /root
).
-Peter
The solution to a problem changes the nature of the problem. -- Peer
I don't know. The code that does it is in /etc/etckeeper/commit.d/50vcs-commit
AFAICS, unless sudo does not set
SUDO_USER
(which it usually does) or "whoami" does not output a username, that code always setsGIT_AUTHOR_NAME
etc, which avoid git failing in that way.I've hit the same issue, it seems to be due to
50vcs-commit
not settingGIT_COMMITTER_NAME
.I've fixed it with the following patch:
Where/how can I contribute this? I've seen multiple github repos, can the author point me to the correct place? Thanks