Skip to content

Show warning for a long commit message - #7399

Merged
João Moreno (joaomoreno) merged 1 commit into
microsoft:masterfrom
sijad:long-commit
Jun 9, 2016
Merged

João Moreno (joaomoreno) merged 1 commit into
microsoft:masterfrom
sijad:long-commit

Conversation

@sijad

@sijad Sajjad Hashemian (sijad) commented Jun 8, 2016 •

Copy link
Copy Markdown
Contributor

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

@mention-bot

Copy link
Copy Markdown

By analyzing the blame information on this pull request, we identified Erich Gamma (@egamma) and João Moreno (@joaomoreno) to be potential reviewers

@msftclas

Hi Sajjad Hashemian (@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;

@sijad

Sajjad Hashemian (sijad) commented Jun 9, 2016 •

Copy link
Copy Markdown
Contributor Author

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
João Moreno (joaomoreno) merged commit d1232cb into microsoft:master Jun 9, 2016
@joaomoreno

João Moreno (joaomoreno) commented Jun 9, 2016 •

Copy link
Copy Markdown
Contributor

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
Sajjad Hashemian (sijad) deleted the long-commit branch June 9, 2016 10:50
@massimocode

Copy link
Copy Markdown

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

@massimocode

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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

@n370

Copy link
Copy Markdown

László Simon (@Pho3nixHun) fair enough!

@robsonsobral

Copy link
Copy Markdown

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