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

user.name/user.email should be configured globally to work with submodules #289

Open
vmallet opened this issue Feb 11, 2023 · 1 comment

Comments

@vmallet
Copy link

vmallet commented Feb 11, 2023

The Get part of the resource configures both user.name and user.email in the main repo in case a commit needs to happen while merging/rebasing the PR branch (source). However the configuration isn't propagated down to submodules, and if such a commit is required for one of the submodules, the commit will fail with Git being very unhappy about not having a name and/or email for the user.

Output example
10:21:29 selected worker: concourse-worker-32
10:21:31 Initialized empty Git repository in /tmp/build/get/.git/
10:21:31 Switched to a new branch 'main'
10:21:33 Submodule 'modules/something' (https://..../something) registered for path 'modules/something'
10:21:33 Cloning into '/tmp/build/get/modules/something'...
10:21:34 Submodule path 'modules/something': checked out '123f0ec9cb46ddb482a480e564563ffb698db3ef'
10:21:35 Updating 57fd81d..c5789e9
10:21:35 Fast-forward
10:21:35
10:21:35 *** Please tell me who you are.
10:21:35
10:21:35 Run
10:21:35
10:21:35  git config --global user.email "[email protected]"
10:21:35  git config --global user.name "Your Name"
10:21:35
10:21:35 to set your account's default identity.
10:21:35 Omit --global to set the identity only in this repository.
10:21:35
10:21:35 fatal: unable to auto-detect email address (got 'root@1e-bd04-2b04-8404-12345606ee41.(none)')
10:21:35 Unable to merge '1283dbe90a633442c1269d564c26c5eb078f3df3' in submodule path 'modules/something'
10:21:35 2023/02/10 18:21:35 get failed: submodule update failed: exit status 2

One way to work around this is to add --global to the user.name/user.email config commands to make them global, which seems reasonable in a dockerized environment.

@bgandon
Copy link

bgandon commented May 10, 2024

Unfortunately, there is no hope that you get any support here (#246 was 2+y ago).

But recent news is that the Cloud Foundry community is now maintaining a fork of this resource at cloudfoundry-community/github-pr-resource.

On our Concourse installation at Gstack, that one is already working fine. The change you're describing is both reasonable and quite trivial. Could you suggest a PR there?

(the new resource is a drop-in replacement; you only have to switch telia-ossto cfcommunity in in the resource_types: declaration, i.e. specify repository: cfcommunity/github-pr-resource)

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

2 participants