TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A Note About Git Commit Messages

104 pointsby sant0sk1over 14 years ago

9 comments

davidcuddebackover 14 years ago
I find it unnatural to write commit messages in the present tense. To me, it seems like commit messages are a log of what work has been done, which would naturally be described in past tense. Nonetheless, I do write my commit logs in present tense for the sake of consistency.<p>Does anyone have a good explanation of why commit messages should be in the present tense? (Beyond what the article says: "This convention matches up with commit messages generated by commands like git merge and git revert.") Why do commands like git merge and git revert generate commit messages in the present tense? The best explanation that I can think of is an analogy to literature: literary analysis is written in the present tense, because any time you open a book, the story is happening now, in the present tense. I don't quite buy that, but it's the best explanation I've come up with.
评论 #2079997 未加载
评论 #2080122 未加载
评论 #2080024 未加载
评论 #2079983 未加载
评论 #2080463 未加载
评论 #2080474 未加载
评论 #2080090 未加载
评论 #2080968 未加载
评论 #2080001 未加载
nailerover 14 years ago
&#62; wrapping your commit messages to 72 columns<p>&#62; On an 80 column terminal<p>&#62; Good email netiquette dictates we wrap our plain text emails (for) an 80 column terminal.<p>I think format should be separated from presentation and presuming people should use a particular display device is wrong. These are well established principles and Unix, although lacking a tradition of interface design, isn't some kind of exception.<p>* I use a modern email program (I use gmail but this would include, say, mutt).<p>* I sometimes use a wider terminal. Sometimes I use a narrower one. On my system (OS X default 10.6) less handles this just fine unless some 72-character-neckbeard screws it up.<p>* I sometimes use a GUI tool to examine messages, like github. These may be wider or narrower.<p>In all these cases forced 72 character wrappings look terrible.
评论 #2080347 未加载
评论 #2080520 未加载
评论 #2080153 未加载
评论 #2080220 未加载
评论 #2084926 未加载
评论 #2084136 未加载
e40over 14 years ago
This may be a mundane post, but it's sorely needed IMO. Way too many people create crappy commit messages. I've started kicking them back to the developer to fix.
评论 #2079802 未加载
telemachosover 14 years ago
And in case anyone needs negative examples (or a good laugh), check out <a href="http://whatthecommit.com/" rel="nofollow">http://whatthecommit.com/</a>
yannkover 14 years ago
The recent-ish vim syntax file for git commit message takes those recommendations into account - they don't do anything about the present vs. past tense obviously, but come up with color warnings, which helps a lot. That's actually how I learned about those preferences and the reasoning behind in the first place btw.
评论 #2080143 未加载
brown9-2over 14 years ago
I consider "ability to write a good SCM commit message" one of the boxes to check on my "Is this person a good developer?" checklist.
198dover 14 years ago
Ever since reading that post, I've tried my best to adhere to similar guidelines. On a personal level, it kind of gives you a little 'retro' on what is was you just did, which is never a bad thing. I've also found myself making larger, more meaningful commits, which, I think, is a good thing.
评论 #2079905 未加载
binspaceover 14 years ago
72 character lines is unnatural to read for long sentences (especially in web browsers).<p>Also, less has line wrapping and who develops using 80 character terminals anymore? Maybe the author has a time machine back to 1981? I want access to that!
评论 #2082076 未加载
mikeklaasover 14 years ago
My favourite commit message this week:<p>"improve crapping"<p>(typo: should be cropping)