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

git-pull-request needs user.email but does not check global includes #546

Closed
smemsh opened this issue Jun 27, 2016 · 4 comments
Closed

git-pull-request needs user.email but does not check global includes #546

smemsh opened this issue Jun 27, 2016 · 4 comments

Comments

@smemsh
Copy link

smemsh commented Jun 27, 2016

In git-pull-request there is on L29:

user=$(git config --global user.email)
test -z "$user" && abort "git config user.email required"

but if I set user.email from an include section via ~/.gitconfig, this is not shown due to this default behavior of git:

--[no-]includes
        Respect include.*  directives in config files when looking up
        values. Defaults to off when a specific file is given (e.g., using
        --file, --global, etc) and on when searching all config files.

this would force me to set user.email directly in ~/.gitconfig and not in an [include] section. I think this is not really a sane default for git, but nonetheless, that's what they chose. Therefore git-pull-request needs to add --includes to this line to pull it in. What might also work is removing --global (which works fine, and pulls in includes). I don't see why it's needed; only the value is really needed, it should not matter if it comes from repo-local, global, include, or wherever.

@smemsh
Copy link
Author

smemsh commented Jun 27, 2016

note, I did not look elsewhere in the source tree to see if this same problem exists in other subcommands; it may. The tools shouldn't require the user to use a single-file flat .gitconfig.

@spacewander
Copy link
Collaborator

Would you like to send a pr?

@nicolaiskogheim
Copy link
Collaborator

I've opened a PR that should resolve this issue.

@nicolaiskogheim
Copy link
Collaborator

@smemsh Please re-open if your issue still persist.

timfeirg referenced this issue in timfeirg/git-extras Apr 26, 2019
pull-request: should read local config if present
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