Thursday, October 07, 2021

Git tip: Visual indicator of the 50-character git commit summary message limit

Although it's somewhat too short for my taste, I generally comply with the conventional wisdom of having the summary line of git commit messages be no more than 50 characters.

Even using an editor that shows the current position of the insertion point (such as vim with set ruler enabled), it's not readily discernible how much of the available 50 characters remains, relative to text that has been keyed in so far.

My solution to this has been to set up a ".gitmessage" commit message template that includes a comment showing the 50-character limit:

 
 
#                                                  |<-- 50 char summary line limit

As long as my summary message ends before that vertical pipe character, I'm good!

No comments:

Post a Comment

Non-spammers: Thanks for visiting! Please go ahead and leave a comment; I read them all!

Attention SPAMMERS: I review all comments before they get posted, and I REPORT 100% of spam comments to Google as spam! Why not avoid getting your account banned as quickly -- and save us both a little time -- by skipping this comment form and moving on to the next one on your list? Thanks, and I hope you have a great day!