3 ms·
You're right. I cringe a bit when I hear people say "I've not committed for a while, I'll do it now". Ok, and if I need to revert any of it, I'll have to do it
by philjackson 12y ago
You're right. I cringe a bit when I hear people say "I've not committed for a while, I'll do it now". Ok, and if I need to revert any of it, I'll have to do it hunk by hunk?
- masukomi 12y agocommitting after some random number of saves or lines seems silly yes. but i see no reason to not commit whenever you come to a stopping point. even if that stopping point is as arbitrary as the time to go home. I've never seen a case where someone would revert hunk by hunk. You can just revert to the last stopping point, if you need to, or as most people do just keep editing the file, hitting undo, editing, hitting undo... etc until you have another stopping point. commit. repeat. when you're all done you clean up the commits with rebase and voilla. life is good.
- philjackson 12y agoI'm talking more about the situation a fellow team member has to revert something that Frank wrote that's dropped production at 3am. Trawling through commits that contain half of two small features because he commits based on home time and coffee breaks in an emergency sounds terrible.
- klibertp 12y agoHe will just revert a merge. Because you branch and merge for anything less trivial than one-line comment, right?
- akerl_ 12y agoThat's exactly what the idea is here. If you commit very incrementally during development cycles, you're more likely to have a singular commit to revert. Then before you push upstream, you rebase down your commits into full feature chunks.