Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "Keep my email address private" #387

Closed
atusy opened this issue Mar 17, 2019 · 12 comments · Fixed by #4115
Closed

Support "Keep my email address private" #387

atusy opened this issue Mar 17, 2019 · 12 comments · Fixed by #4115
Labels
aspect: authentication This is a broad, abstract, and almost impractical category that we have yet to sort out. git provider: github meta: never-stale This issue can never become stale type: feature request New feature or request

Comments

@atusy
Copy link

atusy commented Mar 17, 2019

Currently, git config user.email is forced be the one primary in GitHub.
I want to use ID+username@users.noreply.github.com by default when Keep my email address private is enabled ( https://help.github.com/en/articles/about-commit-email-addresses ).
Otherwise, users have to run git config --global user.email "ID+username@users.noreply.github.com" everytime starting new projects.

@kdbeall
Copy link

kdbeall commented Apr 28, 2019

This would be really nice! :)

@Vlaaaaaaad
Copy link

A workaround for this is to go into Environment Variables and to add GIT_AUTHOR_EMAIL and GIT_COMMITTER_EMAIL. I set both to my username@users.noreply.github.com and it works perfectly!

@AlexTugarev AlexTugarev added the aspect: authentication This is a broad, abstract, and almost impractical category that we have yet to sort out. label Sep 9, 2019
@CreatCodeBuild
Copy link

@Vlaaaaaaad It doesn't seem to work for me. Do you need to restart the workspace?

Still, it's Gitpod better make a setting in the GUI for better user experiences.

@jankeromnes
Copy link
Contributor

@CreatCodeBuild yes I think you'd need to restart your workspace for the environment variables to be set.

Also, please make sure that the variable scope properly matches the repository (e.g. scope */* will expose your variables for every project)

@CreatCodeBuild
Copy link

Details:

gp env GIT_AUTHOR_EMAIL=your_value
gp env GIT_COMMITTER_EMAIL=your_value

Then restart your workspace.

@svdarren
Copy link

Setting GIT_COMMITTER_EMAIL in the environment variables page didn't work for me. I had to use this in the .gitpod.yml file:

- command: git config --global user.email $GIT_COMMITTER_EMAIL

I tried it as an init only command, but the environment variables aren't set by that point.

@tekumara
Copy link

I have the following set

$ gp env
GIT_AUTHOR_EMAIL=125105+tekumara@users.noreply.github.com
GIT_COMMITTER_EMAIL=125105+tekumara@users.noreply.github.com

But git config -l still shows my primary email.

@corneliusludmann
Copy link
Contributor

But git config -l still shows my primary email.

Which e-mail addresses are used when you commit changes? git log --pretty=fuller shows me the correct e-mail addresses I've set with GIT_AUTHOR_EMAIL and GIT_COMMITTER_EMAIL independent of what git config -l shows.

Note that you have to restart the workspace after setting env variables with gp env or the web interface.

@tekumara
Copy link

tekumara commented Sep 6, 2020

thanks @corneliusludmann you're right! The env var GIT_AUTHOR_EMAIL overrides the git config for user.email. So git log --pretty=fuller shows the GIT_AUTHOR_EMAIL value.

(GIT_AUTHOR_NAME also sets the name used for the commit).

@sportshead
Copy link

Gitlab support also would be quite nice. This should be fixed ASAP as this would result in private data (user emails) being leaked while commiting.

@corneliusludmann
Copy link
Contributor

@sportshead: For GitLab see this related issue: #2007

@stale
Copy link

stale bot commented Mar 17, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aspect: authentication This is a broad, abstract, and almost impractical category that we have yet to sort out. git provider: github meta: never-stale This issue can never become stale type: feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.