Hacker News new | ask | show | jobs
by bittersweet 5027 days ago
Tim Pope has written about the model commit message [1] and why you should use a short first line, I'm a big believer in this setup and it's done wonders for the readability of my commit messages.

Github itself even uses these rules [2] so I think it's slightly annoying people don't follow them as it looks worse if you use long first lines on the website.

[1] http://tbaggery.com/2008/04/19/a-note-about-git-commit-messa... [2] https://github.com/blog/926-shiny-new-commit-styles

1 comments

Keep in mind "it looks worse if you use long first lines on the website" is a completely arbitrarily imposed issue from GitHub. A while back they just wrapped the text and all was right in the world. Now they truncate the message and it looks like garbage.
However in this case "the website" is just one of dozens of tools out in the world. 50-character summary messages are incredibly awesome across the board, and everyone should learn to write them.
I cannot disagree any more. I haven't used a terminal that can't wrap in probably 15 years. The point of a commit message is to convey information. If you could point me to a study or something showing people retain info or learn better with a 50 char limit, awesome. But until then, I stand by it being a completely arbitrary restriction.
Sorry, but your opinion is wrong and harmful. The point of the summary line is a succinct and scannable summary of the commit.

Open up any git GUI; gitk or SourceTree are my two favorite. If you keep your summary lines under 50 characters you can quickly scan a maximal number of commits. Detailed descriptions are great and should be included as well for any substantial commits, but that is not what you want in the summary. That should be added in separate paragraphs after the summary line.

This is not arbitrary, and it has nothing to do with the ability to line wrap, it's about efficient communication faced with a history of tens or hundreds of thousands of commits over time.