Git Message Verbosity

I love me a long git commit message. I’m telling a story and by George you’re going to see it, read it, and love it.
Well, I think you should, I think my future self should.
But there is this prompting from the docs:

Though not required, it’s a good idea to begin the commit message with a single short (less than 50 character) line summarizing the change

Okay, fine, I’ll try and keep it short.

Oh, we keep on reading the manpage:

followed by a blank line and then a more thorough description. The text up to the first blank line in a commit message is treated as the commit title, and that title is used throughout Git.

Well, why didn’t you say so? I can do that.

This is a less than 50 character commit message

And here is my novel of attempts and retreats and victories and coups and the final written history for history is written by the victors and I am victorious. Except for that method in that class...that's still shite.

Jeeze, 50 characters is nothing. I’ve seen 80 listed as an option too…I may need to stick to that number.

We should probably also wrap our long novel at 80 characters. You can count that out if your on command line, but if you’re using PHPStorm and probably other IDE’s you can force yourself to follow these recommendations and do auto wrap, because who are kidding, horse blinders are good sometimes.

In PHPStorm you can find them in Preferences->Version Control->Commit->Commit Message Inspections.

Then your commit interface UI will look like this. Note the line in the commit message box showing how far you have. When you’re typing it’ll wrap the line for you. If you copy and paste something long into it, you’ll be shown a warning.

Leave a Reply

Your email address will not be published. Required fields are marked *