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

Show warning for a long commit message #7399

Merged
merged 1 commit into from
Jun 9, 2016
Merged

Show warning for a long commit message #7399

merged 1 commit into from
Jun 9, 2016

Conversation

sijad
Copy link
Contributor

@sijad sijad commented Jun 8, 2016

fixes #7138
50 characters limit is hardcoded, should it be a configurable setting?

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @egamma and @joaomoreno to be potential reviewers

@msftclas
Copy link

msftclas commented Jun 8, 2016

Hi @sijad, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

The agreement was validated by Microsoft and real humans are currently evaluating your PR.

TTYL, MSBOT;

@joaomoreno joaomoreno added this to the June 2016 milestone Jun 8, 2016
@joaomoreno joaomoreno self-assigned this Jun 8, 2016
@sijad
Copy link
Contributor Author

sijad commented Jun 9, 2016

I'm not sure about the message if you could help me come up with a better one that would be great,
also this changes only check first line of commit, what about to check if other lines are under 72 character?

stopwritingramblingcommitmessages:

Keep your message to 50 characters or less
If you have more to say than that, put it in additional paragraphs wrapped to 72 characters.

@joaomoreno joaomoreno merged commit d1232cb into microsoft:master Jun 9, 2016
@joaomoreno
Copy link
Member

joaomoreno commented Jun 9, 2016

Thanks, looks great! 🍻

I've added a few more changes on top:

  • Rephrased it to It is recommended to keep the commit's first line under 50 characters. Feel free to use more lines for extra information.
  • Added a git.enableLongCommitWarning configuration setting for those who don't want to be disturbed
  • Changed the String split for a RegExp.

@sijad sijad deleted the long-commit branch June 9, 2016 10:50
@massimocode
Copy link

Hey should this be disabled by default? Or at least a bit more generous than 50 chars?

@massimocode
Copy link

I just looked it up and found this conversation on SO
http://stackoverflow.com/questions/2290016/git-commit-messages-50-72-formatting

Seems like the linux kernel contributions recommend 70-75 chars max. Those guys live on the command line where these things matter so I'm guessing we can be a little more relaxed than 50 characters.

@massimocode
Copy link

Looks like the git commit man page recommends 50 characters or less
https://www.kernel.org/pub/software/scm/git/docs/git-commit.html#_discussion

I gotta go retrain myself!

@Pho3nixHun
Copy link

Can we have this 50 character limit as a variable in the config and not hardcoded?

@n370
Copy link

n370 commented Jul 23, 2017

@Pho3nixHun fair enough!

@robsonsobral
Copy link

Is this dead?

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance git commit message (show a counter with (50 - commit message length))
8 participants