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

pull-request command cannot find email settings #625

Closed
jldugger opened this issue Jan 28, 2017 · 6 comments
Closed

pull-request command cannot find email settings #625

jldugger opened this issue Jan 28, 2017 · 6 comments

Comments

@jldugger
Copy link
Contributor

The man page git-commit-tree outlines how user.email is set:

In case (some of) these environment variables are not set, the information is taken from the configuration items user.name and user.email, or, if not present, the environment variable EMAIL,

I'm using EMAIL=jldugger@osuosl.org, and git config recognizes this:

repo $ git config -l | grep user.email
user.email=jldugger@osuosl.org

However, pull-request does not:

repo $ git pull-request
git config user.email required
@spacewander
Copy link
Collaborator

Would you like to submit a pull request to fix this behavior?

@jldugger
Copy link
Contributor Author

Well, shoot, now I can't replicate the git config -lbit. I probably set up an environment variable to fix this and forgot about it.

Would there be an objection to using EMAIL as a fallback if git config user.email is empty?

@nicolaiskogheim
Copy link
Collaborator

Would there be an objection to using EMAIL as a fallback if git config user.email is empty?

@jldugger It doesn't strike me as bad to do that, but I don't think that ever should be necessary. Commit'ing requires email to be set, so that's something a user of git-pr should be expected to do as well. I am voting no to this, mostly because git doesn't fall back to EMAIL.

@jldugger
Copy link
Contributor Author

@nicolaiskogheim actually, git does fall back to EMAIL. It's explicitly mentioned in the git-commit-tree manpage I quoted above. git config simply isn't listing it, presumably because EMAIL is not part of git configuration files.

My purpose here is unify configurations between personal and work computers, and use env variables to manage role dependent settings like EMAIL. This strategy is already working for git itself, but surprisingly not for git-pull-request. It's a pretty simple fix, but I'm not going to bother submitting a PR if maintainers are actively against it.

@nicolaiskogheim
Copy link
Collaborator

nicolaiskogheim commented Feb 1, 2017

@nicolaiskogheim actually, git does fall back to EMAIL

Then we shall do the same.

I apologise. I skimmed this thread and didn't even see that you quoted git. Moreover, I was convinced that git didn't look in the env for email.

I don't know why you were so quick to assume that anyone in here are opposed to doing things like git does. My argument for turning your proposal down was solely based on what I believed git did. As it turns out, both of the statements I claimed true was wrong. And as any logically coherent human being, I must now accept you proposal, and encourage it. Both of which I of course do.

@jldugger
Copy link
Contributor Author

jldugger commented Feb 6, 2017

Change merged, so closing issue.

@jldugger jldugger closed this as completed Feb 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants