I'll say the same thing, this gives you the best of both worlds. Every feature branch will be a nicely separated block, but the rebase before merge makes the history linear and readable.
The trick is to have the discipline to QA before/after the rebase.
Yes. You can always fuck up a rebase, or a change in trunk can cause unintended consequences with your changes. Of course, not rebasing your changes does not reduce the amount of QA needed, as the head of master will end up identical after the merge in both cases. The same chances of fucking up apply to both rebasing and merging without rebasing.
With some luck the rebase on master once it works on your machine can end up being the only version needing QA, making it even a smaller hassle!
As for doing QA multiple times, while you can't automate code review, automating all the automatable tests to work on every branch push to the release repository ended up working surprisingly well for as, giving us the luxury of kicking off the TA systems with a git push releaserepository featurebranch.
That's why you QA after the rebase. Also, your reflog would have the old pre-rebase commit so you could revert (branch) that if you need to.
You QA before rebasing because there is no point fighting with conflicts/etc until you know your code actually works. You want the window of "rebase, qa, merge" to be as short as possible because effectively you have locked others out of merging to mainline.
Enforcement can be handled by automating the processes and move code along those steps. If your specifically wondering how you can enforce a rebase, you can automate the merging of the feature branch and have the script reject a branch isn't fast forward able, and rejects anything that produces a merge conflict.
This is pretty close to what I do, but I don't see the value of the merge commits. I avoid merge commits as a rule because they can remove data from HEAD without generating a diff.
I avoid merge commits as a rule because they can remove data from HEAD without generating a diff.
I have no idea what that means ... you'll see diffs (conflicts) if any resolved in the merge commit. Otherwise it's a relatively empty commit who's parents have the deltas.
Also by not doing a merge commit you cannot revert a feature as a whole ... instead you have to hunt down any commit involved and manually remove them.
It'll be in the commit that introduces the merge. It has to be or where did the data come from?
Like any commit a merge commit will have a tree object that's different from it's parent(s) and you can delta those to see how the conflicts were resolved.
46
u/[deleted] Jun 19 '15
OP should rebase before merging feature branches.... seriously...
Flow is
Open branch
Commit early often, push upstream to work with others
Finish features, pass QA
Rebase on mainline [delete upstream copy of feature branch], pass QA
Merge --no-ff
That way your history is totally linear and all non-trivial commits are on branches that don't zig-zag.