Describe your workflow of using version control (VCS or DVCS)
I'd like to learn other people workflow when using either vcs or dvcs.
Please describe your strategy to handle the following tasks:
Feel free to organize your answer not grouped by the tasks but grouped by whatever you think is relevant but please organize it by VCS/DVCS (please don't mix them).
Thank you.
The main feature all VCS use for the various task you are mentioning is branching : the ability to isolate a development effort in a collaborative way. Since it is a Central VCS, several developers can collaborate on a same branch, with pessimistic or optimistic locks on files, in order to develop a parallel history.
But being a VCS has two major impact on branching:
~ The "publication" process is an active one, with immediate consequences,
~ while the "consuming" part (updating your workspace) is a passive one (you are forced to deal with changes published by other immediately upon update of your workspace)
Now:
Implementing a feature
Any VCS will do that by making a branch, but what greatly surprised me is that a "feature" branch is not easy:
* the feature may grow too complicated
* it may be ready in time for the next release
* only some part of it may need to be merged back into the main development branch
* it may depend on other features which are not fully done yet
So you need to be careful in the way you manage your feature branch, and your commits: if they are tightly related to the same feature, it will go well (you merge the whole thing back to your main development branch when you need it). Otherwise, partial merges are not easy with those tools.
Fixing bugs
The difference between bug fix during development and after release is that, in the former case you can often do it linearly in the same branch, as in the latter case you will have to establish a bug-fix branch, and decide what bugs you will need to back-port to your current development branch.
Code Review
It is best used with external tools (like Crucible for instance), and uses VCS functions like blame or annotations extensively, in order to better assign code fixes after a review.
Refactoring code (post code-review)
If the refactoring is minor, it can go on in the same branch. But if it is big, a special branch needs to be setup, with unit-testing done before beginning said refactoring.
Incorporate patches
Same comment as last point. If the patch is a big one, a branch needs to be created.
Releasing the newer version of your app
A VCS will only get you so far when it comes to releasing your app, because it is not a release management tool.
You will need to formerly identify a version to be released (label), but after that comes the deployment process which involves:
The key things with VCS and release management are:
The release mechanism also has an influence on binary dependencies:
You can also choose to be in source dependencies (and get all the sources of the other internal projects you need for your own), and a VCS is well adapted for that, but it is not always possible/practical to recompile everything.
The main difference with a DVCS (Distributed Version Control) from a VCS, is that it is made (by the very nature of its distributed work) to do one thing, and one thing well:
merge .
So you the tasks you mention can be viewed from that angle.
Branches will still be made, but not all of them will be visible by other developers. Lots of them won't actually leave your local repository.
Being a DVCS has two main impact on merging:
~ the publication process is a passive one: your pushes can be ignored by other repos.
~ the "consuming" part is an active one: you can examine what has been pushed to you before merging that to your branch, and decide what you want to merge and from whom (and not just because you are all working on a "same branch").
Now:
Implement a feature
As I detail in my CVCS (Central VCS) answer, the difficulty behind a "feature" branch is that many sub-features will end-up intertwined.
This is where DVCS will shine as they will allow you to reorganize their local (as in "not pushed yet") history (changesets for Mercurial, SHA1 commits ofr Git), in order to facilitate partial merges, or sub-feature branches creations.
Fixing bugs
You can almost create a branch per bug-fix if you want. The idea is to make sure a bug-fix is identified by a simple linear set of commmits merged back in the development branch (or the maintenance branch if this is released).
I prefer making sure to first rebase the bug-fix branch on top of the development branch (to make sure my fixes are still compliant with any work which may have been done in parallel on said main branch), before merging that dev branch with the bug-fix one (fast-forward merge: the main branch now reference all the fixes)
Code Review
The blame or annotation feature is still there to help assign the tasks during a code review, but this time, all the developers are not necessarily on one site (since it is a *Distributed *VCS), and not with the same identification scheme (not using the same LDAP for instance).
A DVCS way to organize code review is to push new changes to a special code review repo, which will:
Refactoring code (post code-review)
They are done on the developer's local repo, in a branch (since it is so easy to merge it back)
Incorporate patches
Same process than last section.
Releasing the newer version of your app (desktop, web, mobile, would you treat them differently?)
The actual release process is simply initiated by a special identified (tag) version of your software. (the rest of the "release management process", that is the deployment and configuration part is detailed in the CVCS answer)
The question is, with a DVCS:
"from which repository will that official version of your software come from?"
You need to establish a "central" or rather "official" repository which will play the role of:
So it can serve both for release purposes, but also for new development purposes.
链接地址: http://www.djcxy.com/p/49268.html上一篇: 修正共享功能分支的Git工作流程?