tag:blogger.com,1999:blog-7821856652257554779.post5348575405044230778..comments2025-09-20T09:27:07.510+02:00Comments on Andrzej on Software: Small, deployable commitsAndrzej Krzywdahttp://www.blogger.com/profile/06399276063142826365noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-7821856652257554779.post-26574823487382853862011-12-30T19:39:58.891+01:002011-12-30T19:39:58.891+01:00This comment has been removed by the author.Andrzej Krzywdahttps://www.blogger.com/profile/06399276063142826365noreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-60561374085987302232011-12-30T19:39:58.670+01:002011-12-30T19:39:58.670+01:00Thanks for all comments!
First, a clarification -...Thanks for all comments!<br /><br />First, a clarification - when I talked about a commit, I meant a git-like commit, however it's not really that different in this context from Subversion-like comment.<br /><br />@poulwiel:<br /><br />I like the idea of having a quick feedback. That's why i love TDD, that's also why I like continuous deployment.<br /><br />@szeryf<br /><br />When you have a single commit broken (in git) it doesn't break your friend build. <br /><br />Good point with metric_fu.<br /><br />@jasiek<br /><br />I hate feature branches, too complicated for my small brain :)<br /><br />You're right about the possibility of reverting single commits.<br /><br />@Tartley<br /><br />You, sir, must come from a very good school of software development :) I agree with everything you wrote. I'm sure your team-mates will gain a lot when you show them how to refactor with small commits, being green all the time. That's how I learnt it. Pairing with someone who can do that makes miracles.<br /><br />@ncr<br /><br />Reviewing code before a commit may work fine in case of pair programming. In other cases the feedback is too slow and I hope you're not blocking anybody from commiting their changes. I can't see the advantages of such processes.<br />Criticisism is fine :) We sometime cross the line and go into haters-mode, but that's fine. I hate ugly code :)Andrzej Krzywdahttps://www.blogger.com/profile/06399276063142826365noreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-87631022342265099742011-12-30T19:30:34.989+01:002011-12-30T19:30:34.989+01:00We review code before each commit (even css-relate...We review code before each commit (even css-related stuff) and we like it, taking a constructive criticism easily has never been a problem to anyone in our team.<br /><br />Keep writing :)ncrnoreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-38776395738034464272011-12-30T16:03:46.324+01:002011-12-30T16:03:46.324+01:00very interesting points of view, i don't know ...very interesting points of view, i don't know how about You all but i fell that we all think about something else while saying "commit", at least what this "commit" will lead to (i.e. if team is working on one repository or distributed repos), as a consequence we are writing about something slightly different - still it's very interesting read :-)poulwielhttps://www.blogger.com/profile/12346470885295323709noreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-10914541667554420752011-12-30T14:45:38.957+01:002011-12-30T14:45:38.957+01:00Should I refactor before every commit? Definitely ...<b>Should I refactor before every commit?</b> Definitely not, IMHO. :-)<br /><br />I prefer that refactoring is separated out into its own commit. Then others can clearly see which changes are behaviour-preserving, as opposed to actually adding or modifying functionality.<br /><br />I think the urge to keep work private because it isn't finished (e.g. isn't refactored) should be resisted. It's better to be public and transparent about what you're up to. The sooner others see your changes, and the sooner CI gets to run against them, the better for everyone.<br /><br /><b>Should a commit pass all tests?</b><br />I've settled on a style where every commit is deployable, and passes all tests. Sometimes this means labelling the in-progress functional test as 'expected failure'. (Python unittest has a decorator for this, that ignores the failure in test results.) Martin Fowler's book 'Refactoring' describes how to do this in the trickier situations, such as when making a sweeping change that affect lots of code.<br /><br />However, some of my current team-mates don't believe this is possible all the time, and for those times they continue to use feature branches to keep the non-deployable code isolated until it can be made working, then merged with the main development branch. I plan to pair with them on the next such change, to discover which of us is right.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-18205275987766877822011-12-30T13:09:58.974+01:002011-12-30T13:09:58.974+01:00As often as possible - my main reasoning being tha...As often as possible - my main reasoning being that having a finer granularity of changes lets me revert a commit much easier in case of something going awry.<br /><br />We've experimented with pre-commit code reviews with SVN a while ago, and that has worked okay. Our process at the moment uses reviewboard with a branch-per-feature approach - eg. a feature is started, reviewed and finished within a branch, and only then merged into a branch that is later deployed.jasiekhttp://jasiek.posterous.comnoreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-5613059446010335752011-12-30T11:47:00.051+01:002011-12-30T11:47:00.051+01:00Should a commit pass all tests? Definitely. Otherw...<b>Should a commit pass all tests?</b> Definitely. Otherwise, it will mess your colleague's work when they do the update -- they won't know if the the test failed because of what they did or what you did.<br /><br /><b>Should I refactor before every commit?</b> Definitely (at least IMHO). Code that barely passes the tests is just a half-product. A sort of prototype. Something that works, but you wouldn't show it to your colleagues, because it's ugly, repetitive etc. I wouldn't want somebody else to see it or comment on it, while I'm still working on it. For me it's just unfinished.<br /><br />Also, when you have something like metric_fu installed on your continuous integreation, non-refactored commit will likely fail the build. And you get to wear the stupid hat :)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7821856652257554779.post-69053022936839280862011-12-30T10:30:36.815+01:002011-12-30T10:30:36.815+01:00not every commit has to be deployable, i'm wor...not every commit has to be deployable, i'm working on my repo so pulling from it (to the main repo) will be done when things will be ready. it's just my opinion. i find comfortable that i can see the changes from master repo perspective to someone elses repo and decide if it is ready or not.poulwielhttps://www.blogger.com/profile/12346470885295323709noreply@blogger.com