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

feat: Allow git commit message through UI #1541

Merged
merged 4 commits into from
Jun 11, 2018

Conversation

voluntadpear
Copy link
Contributor

Implements #1482.

Hi! I went ahead and implemented support on UI to specify a custom initial git commit message and skip git initialization.

I'm not sure if using a single switch for both actions and skip git initialization if the switch is on but no message is specified is the best approach, I can switch to something else like having different switches if it seems a better option.

Copy link
Member

@Akryum Akryum left a comment

Choose a reason for hiding this comment

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

Thanks for this PR! I have posted a few comments.

@@ -388,6 +399,8 @@ function formDataFactory () {
return {
folder: '',
force: false,
git: false,
Copy link
Member

Choose a reason for hiding this comment

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

This should be true by default to be consistent with the cli behavior.

@@ -191,7 +191,9 @@
},
"options": {
"label": "Additional options",
"description": "Overwrite target folder if it exists"
"description": "Overwrite target folder if it exists",
"git": "Use custom first initial commit message or skip git initialization",
Copy link
Member

Choose a reason for hiding this comment

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

Let's put "Initialize git repository (recommended)".

@@ -281,6 +281,16 @@ async function create (input, context) {
answers.useConfigFiles = 'files'
}

const cliOptions = {git: true}
// Git
if (input.skipGit) {
Copy link
Member

Choose a reason for hiding this comment

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

The name of the variable is wrong, it should be something like enableGit.

// Git
if (input.skipGit) {
if (!input.gitCommit) {
cliOptions.git = 'false'
Copy link
Member

Choose a reason for hiding this comment

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

Should be false.

@@ -37,6 +37,8 @@ input ProjectCreateInput {
remote: Boolean
clone: Boolean
save: String
skipGit: Boolean!
Copy link
Member

Choose a reason for hiding this comment

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

enableGit

@@ -512,6 +525,8 @@ export default {
input: {
folder: this.formData.folder,
force: this.formData.force,
skipGit: this.formData.git,
Copy link
Member

Choose a reason for hiding this comment

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

enableGit

@voluntadpear
Copy link
Contributor Author

Thanks for the review! I added the requested changes.

@Akryum Akryum force-pushed the feat/commit-message branch from a8dc019 to 7e77342 Compare June 11, 2018 13:04
@Akryum Akryum merged commit 29c1ce5 into vuejs:dev Jun 11, 2018
@voluntadpear voluntadpear deleted the feat/commit-message branch June 11, 2018 14:53
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

Successfully merging this pull request may close these issues.

2 participants