How to install another author / committer for Git in the TRAMP environment?

I edit files running Git with Emacs 23.3.1 / TRAMP / VC sudoed via 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 use GIT_AUTHOR_NAME / GIT_AUTHOR_EMAIL / GIT_COMMITTER_NAME / GIT_COMMITTER_EMAIL to set it only for my connection.

I did not find a way to install the environment / change the command in vc-git . Adding environment variables to tramp-remote-process-environment :

 (add-to-list 'tramp-remote-process-environment " GIT_AUTHOR_EMAIL=tim@tim-landscheidt.de ") (add-to-list 'tramp-remote-process-environment "GIT_AUTHOR_NAME='Tim Landscheidt'") (add-to-list 'tramp-remote-process-environment " GIT_COMMITTER_EMAIL=tim@tim-landscheidt.de ") (add-to-list 'tramp-remote-process-environment "GIT_COMMITTER_EMAIL='Tim Landscheidt'") 

it works, but I'm afraid it might bite me in the future when I want to work on a host where I need a different personality.

Is there a way to set another author / committer limited to one TRAMP connection?

+4
source share
1 answer

I don't know anything about TRAMP, but I can point out that you can set user.email and user.name separately for a specific repository by setting them in .git/config or by running the commands:

 git config --local user.name "Tim Landscheidt" git config --local user.email " tim@tim-landscheidt.de " 

Thus, you can have different settings for the author / committer for each repository.

0
source

Source: https://habr.com/ru/post/1484281/


All Articles