Skip to content

olets/git-commit-message-summary-length

Repository files navigation

git-commit-message-summary-length GitHub release (latest by date) GitHub commits since latest release

git-commit-message-summary-length: Check the length of a commit message's first line.

splash card

In a nutshell

 

Tip

  Check out the full docs at https://git-commit-message-summary-length.olets.dev  

 

git commit-message-summary-length [--error-after=<length>] [--log-level=<log level>] [--warn-after=<length>] [<revision>]

Succeeds if the commit message summary's length is less than or equal to the "error after" length (default 72).

Fails if the commit message summary's length is greater than the "error after" length (default 72).

revision (default HEAD) is any revision parameter accepted by git log -1.

If the log level is 0, the command has no output.

If the log level is 1, the integer length of the commit message is logged.

If the log level is 2, the length of the commit message is logged in a sentence. It's colored yellow if the commit message summary's length is more than the "warn after" (default 50) length and shorter than or equal to the "error after" (default 72) length; it's colored red if the message is longer than the "error after" (default 72) length.

If the log level is 3 (default)

  • as with log level 2, the length of the commit message is logged in a sentence. It's colored yellow if the commit message summary's length is more than the "warn after" (default 50) length and shorter than or equal to the "error after" (default 72) length; it's colored red if the message is longer than the "error after" (default 72) length

  • and the commit message is logged, with characters after "warn after" and up to "error after" highlighted in yellow, and characters after "warn after" highlighted in red.

Documentation

https://git-commit-message-summary-length.olets.dev

Changelog

See the CHANGELOG file.

Contributing

Thanks for your interest. Contributions are welcome!

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Check the Issues to see if your topic has been discussed before or if it is being worked on.

Please read CONTRIBUTING.md before opening a pull request.

License

git-commit-message-summary-length by Henry Bley-Vroman is, with the exception of its logo as covered below, licensed under a license which is the unmodified text of CC BY-NC-SA 4.0 and the unmodified text of a Hippocratic License 3. It is not affiliated with Creative Commons or the Organization for Ethical Source.

Human-readable summary of (and not a substitute for) the LICENSE file:

You are free to

  • Share — copy and redistribute the material in any medium or format
  • Adapt — remix, transform, and build upon the material

Under the following terms

  • Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • Non-commercial — You may not use the material for commercial purposes.
  • Ethics - You must abide by the ethical standards specified in the Hippocratic License 3 with Ecocide, Extractive Industries, US Tariff Act, Mass Surveillance, Military Activities, and Media modules.
  • Preserve terms — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
  • No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.

Related

I've created other command line tools, including other Git tools. Check them out at https://olets.dev/software/.