Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Fixes #3511: Check Git user before committing, set dummy user if necessary #3541

Merged
merged 12 commits into from
Apr 13, 2019

Conversation

danepowell
Copy link
Contributor

@danepowell danepowell commented Apr 10, 2019

Fixes #3511

Changes proposed

  • Better document git.user.name and git.user.email config properties in build.yml (these already existed before as an undocumented feature for deploys)
  • Add a validation function (validateGitConfig) that ensures that the Git user is set correctly either via the system or via the above config properties
  • Use this validation function prior to deploys and new project creation (the only two places we do Git commits)
  • If git.user.name and git.user.email are set, add an --author argument to Git commits during deploys and new project creation.
  • Add an empty "precommit" during project creation to make @TravisCarden happy 😄

I haven't fully tested this yet, it very well might not work just yet. There's probably some opportunity to refactor the construction of the commit command. But I'd still appreciate any feedback.

@ba66e77 this is modifying a feature that you originally requested in #1323 , on the off chance that that is something precious to you. I think it should operate basically the same, except that we'll set the Git user on each commit rather than once for the whole repo.

@danepowell danepowell added Enhancement A feature or feature request 10.x labels Apr 10, 2019
Copy link
Contributor

@TravisCarden TravisCarden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested it, either, but the design seems good, and the implementation looks reasonable.

@danepowell
Copy link
Contributor Author

I refactored the Git commands into their own class, so we can set the author consistently for commits.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Enhancement A feature or feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New project creation fails if global Git user is unconfigured
3 participants