2 ms·
I can belive that keeping files under vc is generally beneficial. But what I'm not so sure about and what I wonder if it is worth the trouble making elaborate c
by bjourne 14y ago
I can belive that keeping files under vc is generally beneficial. But what I'm not so sure about and what I wonder if it is worth the trouble making elaborate commits? It's the difference between anal committing and loose committing.
In the first style you ensure that your commit messages properly describe what bugs your checkin fixes, that it follows the formatting convention you have for writing checkin messages, that there are no extraneous whitespace changes producing unnecessary hunks and that you don't accidentally insert a big block of uncommented out code.
Loose committing is when you periodically commit the stuff you are working on. Several times per day, when you feel you've reached something good, you checkin what is in your repository and, at best, you write a comment like "fixed the bug with bla".
Of course, there are several possible shades of gray between totally loose and totally anal committing. What is the right strategy may very well vary depending on how many developers are involved in the project.
For me, I've found that loose works best for my own projects. Prettifying commits and thinking up good descriptions is annoying and can disrupt my flow. I can't be bothered to force myself to do it just "because it's the right thing" and I usually don't revisit old commits anyway. I'd definitely like to hear other developers thoughts on the issue though.
- kabdib 14y agoIt depends on the project you're on, and what phase of development you're in. If you work on your own, do anything you like. If you work on something being used daily by tens of millions of people, upon which your company's lifeblood depends, you're more careful. Actually checking in code is somewhat anticlimactic; leading up to that, you've run a bunch of tests, gotten a code review, and satisfied yourself that the change is appropriate and necessary. Post-checkin, you monitor the build, make sure that BVTs work, and basically make sure you haven't broken anything. A good checkin isn't a big deal. It's the stuff around it that matters.
- spacemanaki 14y agoDepending on the size and culture of the team you're working on, I think that requiring detailed commit messages can't really hurt that much. My problem with playing fast and loose with commit messages is that if you have no standards at all, or very loose standards, when things slip a little bit you can end up with utter garbage -- like a string of commits on a feature/topic branch all with the message '...' which are next to useless (not made up). If you have even slightly stringent standards in place, then when things slip it's not the end of the world. If someone forgets to include the ticket number of a bug or feature, but has relatively detailed commit messages, the messages are still useful. I'm not advocating rejecting pull requests because commit message formatting is off (lines > 80 chars or no short description for the first line, etc), but just paying attention to the stuff that really matters. I think of commit messages like emails to my colleagues. I wouldn't write junk emails that had poor grammar and spelling, or emails that required you to have unreasonable amount of context to understand, and I don't do that with commit messages either.