Skip to content
This repository has been archived by the owner on Feb 5, 2018. It is now read-only.

Tool to prompt user for commit #9

Closed
jimthedev opened this issue Apr 8, 2015 · 13 comments
Closed

Tool to prompt user for commit #9

jimthedev opened this issue Apr 8, 2015 · 13 comments

Comments

@jimthedev
Copy link

Hi Steve,

Wasn't sure where to put this or how I could reach out to you other than Github so please close as needed.

I think the conventional commit format is great but IMO there is a missing piece right now for people who just want to make commits to a repo without remembering the exact formatting spec that a repo author prefers. Sometimes I want to commit to a repo and there is a specific format that the repo author prefers. This is great but ideally I, as the contributor, would prefer to be prompted for the required commit message fields rather than having to remember the convention of every repo. It also isn't helpful for ides or scm tools that might want to change their behavior based on a repo's preferred commit format.

Git pre-commit hooks are great for stopping me, the one-off contributor, from doing harm, but from a tooling perspective they leave something to be desired because they don't actively prompt me for the require commit fields using something like inquirer.

So I wanted to get your pulse on this so see if you think it would be possible or even preferable to have some sort of config file that repo authors could include in the repo that defines certain norms when it comes to commit messages.

Since you're writing the updated parser and writer for changelog, I figured it was worth checking in. I haven't worked out the details yet but my guess is that it would be something like .commitformat or .commitconvention

Any overlap between this and what you're working on?

Thoughts.

@stevemao
Copy link
Collaborator

stevemao commented Apr 8, 2015

Thank you for submitting this

First, this convention is not invented by me. Angular project first adapted it and it is used by a lot of projects now. You don't have to remember the rule but you can choose weather to use it in your project.

Second, you don't have to follow this rule to use this module. This module tries to parse your commits based on this rule but if certain bits are missing, it will be null and pass it to downstream.

Last, you can use a pre commit hook in your project along with this one. I won't include a precook module in this one because of separation of concerns. I'm not sure if there's an existing one for angular but if not, anybody can write one.

Sent from my iPhone

On 9 Apr 2015, at 7:31 am, Jim Cummins notifications@github.com wrote:

Hi Steve,

Wasn't sure where to put this or how I could reach out to you other than Github so please close as needed.

I think the conventional commit format is great but IMO there is a missing piece right now for people who just want to make commits to a repo without remembering the exact formatting spec that a repo author prefers. Sometimes I want to commit to a repo and there is a specific format that the repo author prefers. This is great but ideally I, as the contributor, would prefer to be prompted for the required commit message fields rather than having to remember the convention of every repo. It also isn't helpful for ides or scm tools that might want to change their behavior based on a repo's preferred commit format.

Git pre-commit hooks are great for stopping me, the one-off contributor, from doing harm, but from a tooling perspective they leave something to be desired because they don't actively prompt me for the require commit fields using something like inquirer.

So I wanted to get your pulse on this so see if you think it would be possible or even preferable to have some sort of config file that repo authors could include in the repo that defines certain norms when it comes to commit messages.

Since you're writing the updated parser and writer for changelog, I figured it was worth checking in. I haven't worked out the details yet but my guess is that it would be something like .commitformat or .commitconvention

Any overlap between this and what you're working on?

Thoughts.


Reply to this email directly or view it on GitHub.

@jimthedev
Copy link
Author

Thanks. I think I understand. Appreciate it.

@stevemao
Copy link
Collaborator

stevemao commented Apr 8, 2015

I think https://github.com/jzaefferer/commitplease might do

@jimthedev
Copy link
Author

Thanks. Looks like a commit hook. Angular already has one here: https://github.com/angular/angular.js/blob/master/validate-commit-msg.js

I guess my point is that I'd like something that the user can run that explicitly asks for the fields rather than using true/false.

@stevemao
Copy link
Collaborator

stevemao commented Apr 9, 2015

So you want something like this:

What's the type:
> fix
What's the scope
> $http
What's the subject
> make it work

@jimthedev
Copy link
Author

Yep! And I know how to accomplish this using Inquirer but figured there might be more conventions than the one used by the Angular team (you mentioned the JQuery example) and a good tool would look to the repo for a config file to determine these questions.

@stevemao
Copy link
Collaborator

stevemao commented Apr 9, 2015

I guess if user can configure the rules that would be great

@stevemao
Copy link
Collaborator

stevemao commented Apr 9, 2015

👍 Thanks. This inspires me

@stevemao stevemao changed the title Commit format common spec? Tool to prompt user for commit Apr 9, 2015
@jimthedev
Copy link
Author

Great! Thanks for your work on conventional commit. It looks great. Excited for the eventual merge.

@stevemao
Copy link
Collaborator

stevemao commented Apr 9, 2015

If you wanna do it, go ahead and let me know. If not, I'll eventually do it. Thanks for this idea.

@jimthedev
Copy link
Author

@stevemao I have some alpha code for this. It works pretty well. Will post soon.

@jimthedev
Copy link
Author

@stevemao Released Commitizen here: http://commitizen.github.io/cz-cli/

Would appreciate any feedback.

@stevemao
Copy link
Collaborator

Will have a look when I have time. Thanks @jimthedev

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

No branches or pull requests

2 participants