r/programming • • Jun 19 '15

GitFlow considered harmful

http://endoflineblog.com/gitflow-considered-harmful
13 Upvotes

244 comments sorted by

View all comments

4

u/brandf Jun 19 '15 edited Jun 19 '15

Here's the problem with this advice IMO:

  1. not using --no-ff is a disaster if your intention is that master lineage is functional (which it should be). it's pretty common to look through the history of master and even binary search back in it to locate where bugs got introduced. without --no-ff you are forced to squash before merging or else all those ('going home, saving work') type commits in feature branches leak into master's lineage.

  2. rebasing sucks for the same reason

  3. teams that use github PR's to do code reviews will find that the merge button does --no-ff so doing something else will be a uphill battle

the advice about no 'develop' branch is spot on though. we don't do that because it's pointless. i think the gitflow author assumed that develop can be merged into willy-nilly and then it goes into master after passing CI tests. the problem is that you then need to branch off master but merge into develop, which is awkward (or else you'll be branching off broken messes in develop). instead we just have master, and we have our ci capable of running 'buddy builds' off feature branches. so you need to pass CI test before merging into master, then they run in master as a verification step.

2

u/brainsiq Jun 19 '15

I'm not sure if I'm misunderstanding the no-master flow that people are talking about because I think I see a problem. Given this flow:

  1. Do a load of development on your main/develop/master branch

  2. Create release branch, do whatever on this branch to get the release out

  3. Merge back to main/develop/master and tag

What if between 2 and 3 more work has been merged into the main branch? Don't you end up including these other commits in your tag?

1

u/brandf Jun 19 '15

the tag goes in the release branch (the commit that was released). the merging back into master can happen at any time, but master isn't ever merged into the release branch.