I edit files under Git control with Emacs 23.3.1/TRAMP/VC sudoed over an ssh connection (/sudo:sudouser@host:file
with tramp-default-proxies-alist
set accordingly). sudouser
is a shared account, so I don't want to set user.email
/user.name
globally, but instead use GIT_AUTHOR_NAME
/GIT_AUTHOR_EMAIL
/GIT_COMMITTER_NAME
/GIT_COMMITTER_EMAIL
to set it just for my connection.
I did not find a way to set an environment/change the command in vc-git
itself. Adding the environment variables to tramp-remote-process-environment
:
(add-to-list 'tramp-remote-process-environment "[email protected]")
(add-to-list 'tramp-remote-process-environment "GIT_AUTHOR_NAME='Tim Landscheidt'")
(add-to-list 'tramp-remote-process-environment "[email protected]")
(add-to-list 'tramp-remote-process-environment "GIT_COMMITTER_EMAIL='Tim Landscheidt'")
works, but I fear it might bite me in the future when I want to work on a host where I need another identity.
Is there a way to set a different author/committer limited to one TRAMP connection?
~/.gitconfig
or.git/config
doesn't matter; the problem is that it is a shared account, and I don't want others (accidentally) posing as myself. – Czarevna