lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Feature Request: commit message length warning

Open decoyjoe opened this issue 4 years ago • 5 comments

There's a convention that the line length of commit messages should be limited to 50/72 characters.

Both VSCode (git.inputValidationLength) and Vim (gitcommitSummary) have features where the editor will warn you when the length of the current line of the commit message is greater than a configured limit.

It would be nice if lazygit had this same functionality where a warning will be displayed in the commit message input prompt if the current line length is greater than the configuration setting commitLengthWarning: <int>.

decoyjoe avatar Oct 27 '21 22:10 decoyjoe

Totally agree, I think it can be really simple like I have in zsh where the commit message starts getting red characters when you pass 72 chars.

GMkonan avatar Jun 02 '22 13:06 GMkonan

I can create a PR for this later since I already have made the commit on my fork, people interested can check the changes here:

  • https://github.com/jesseduffield/lazygit/compare/master...GMkonan:commit-message-length-warning

GMkonan avatar Jun 23 '22 11:06 GMkonan

Is anyone interested in opening this issue back up?

About 2 years since the issue's creation, and more than a year since the PR was created by @GMkonan. Coming up on a year since the last comment.

Xevion avatar Sep 16 '23 22:09 Xevion

Yeah, I would like to have this feature too. Now I edit the commit message in another git client before pushing 😜

stigkj avatar Jan 25 '24 07:01 stigkj

Please give #3173 a try then, I think it's much better than what's proposed here.

stefanhaller avatar Jan 25 '24 07:01 stefanhaller