concourse / pool-resource

atomically manages the state of the world (e.g. external environments)
Apache License 2.0
54 stars 36 forks source link

Avoid hard code git user name/email is already set #65

Closed ywei2017 closed 2 years ago

ywei2017 commented 2 years ago

The hard-coded git user name/email causes failures when the git server does pre-hook to verifying the push user and commit user must match.

ywei2017 commented 2 years ago

@clarafu any thought or comments on the PR.

xtremerui commented 2 years ago

Is there a way to check if those values are set in git_config first insteand of running the cmd to get an actual error?

ywei2017 commented 2 years ago

Is there a way to check if those values are set in git_config first insteand of running the cmd to get an actual error?

Let me check on it

ywei2017 commented 2 years ago

Read more on the git config docs. Unless we check the ~/.gitconfig file, I can't think of a way. Actually, git config key_name is basically doing that -- returning the configured value with exit 0 if exist, otherwise with exit 1.