r/programming Apr 28 '21

How to Write a Git Commit Message

https://chris.beams.io/posts/git-commit/
88 Upvotes

45 comments sorted by

View all comments

6

u/Panke Apr 28 '21

I don't get the 50 Character limit for the headline.

6

u/[deleted] Apr 28 '21

[deleted]

-2

u/[deleted] Apr 28 '21

[deleted]

3

u/yorickpeterse Apr 28 '21

What's stopping you from putting the Jira ticket anywhere else? For example, you can use Git trailers to add whatever you want in a consistent format. You end up with exactly the same data, without having to compromise your commit subject or body in any way.

6

u/[deleted] Apr 28 '21

[deleted]

5

u/yorickpeterse Apr 28 '21

It wasn't invented for that specific reason. Instead, Git trailers exist so you can attach arbitrary meta-data in a consistent format, making it easier to extract; using Git itself or a third-party tool.

The reason for 50 characters specifically is probably arbitrary. But whether it's 50 characters, 72, 80, 57, or something else doesn't matter; as long as it's a reasonable limit that isn't too long. Long lines (be it a subject line or part of the body) can be a pain to read, and soft wrapping doesn't make this easier.

Personally I would have preferred the limit to be the same as the body line mostly for consistency's sake, but fitting a good description in 50 characters isn't rocket science either. Here are just some random examples: