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?
I know nothing of TRAMP, but I can point out that you can set user.email
and user.name
individually for a particular repository by setting them in .git/config
or by doing the commands:
git config --local user.name "Tim Landscheidt"
git config --local user.email "[email protected]"
So that way you can have different settings for author/committer for each repository.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With