#Cherry pick commits to merge smartgit code#That means if you need to fix a bug for a release, you fix it in release and then merge the fix "up" to master/develop or whatever.īasically, I want to make 100% sure that newer releases and bleeding edge code is a perfect superset of older releases, and doing it this way removes almost all of the guesswork. I prefer making changes in the oldest applicable branch and merging them in-order into newer branches. Different perspectives and experience are really what makes answers to these kinds of opinion-based questions valuable. #Cherry pick commits to merge smartgit professional#I'd really love to hear the opinions of folks with experience in this area in either a professional or open source setting. I want this to be a learning opportunity. Assuming one isn't a replacement for the other, nor is one worse than the other really, what are some good criteria for choosing between them? What about personal experiences folks have had with either? So ultimately my question is: When would you choose one or the other? I heard from a co-worker that cherry-picking in this way is the "new" way of doing things these days, although I haven't ever personally heard that elsewhere. Specifically the question asks about merging contributor changes, which is a lot different (and a much more straightforward problem to solve by comparison). Note that I did find a stackoverflow question that sort-of touches on this topic, but it is done in a different context. Orphaned commits are more likely, especially if you forget to tag after you are done. #Cherry pick commits to merge smartgit Patch#For example, if your commit structure on master is: BUG FIX -> BIG FEATURE -> BUG FIX, cherry picking the BUG FIX -> BUG FIX can be tough, if BIG FEATURE affects the patch of the 2nd bug fix.Ĭherry picking is ultimately less intuitive than a merge and doesn't establish ancestry. Makes release and hotfix branches more adhoc and "means-to-an-end", instead of central branches where developers work together each time (which tends to take the focus away from master).ĭepending on your release model, for example if you hotfix a lot, or your release branches are super long lived, you could get into "cherry-pick hell", where you do it too often.Ĭherry picking commits with dependent changes between them is a nightmare. Keeps the focus on master as the primary development platform. In a way, it's better for the initial fix to be done "well" on master, and then whatever goes back to the hotfix branch can be done in an adhoc/hacky way (because it is essentially throw away work, not going to be merged forward and kept, so extra effort can be reduced as long as the business objective is met). If you hotfix far back enough in time, a bug fix may need to be completely reimplemented. It's easier to cherry pick 1 small bug fix commit than it is to cherry pick multiple commits composing of a larger feature. Somewhat helps prevent feature creep (for release branches mostly). Helps encourage less hotfixing of previous releases (because if you did it often enough, cherry pick becomes a pain) Note that the same semantics apply to release branches as well, as I understand it. I've worked at places (and also seen open source projects do it, such as the Nextcloud Server project on Github) where when a hotfix of a previous release is needed, developers selectively cherry pick changes backwards, tag the hotfix branch, ship the release, and never merge the hotfix back to master. I haven't seen a lot of reading material on this specific scenario.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |