r/coding • • Jun 19 '15

GitFlow considered harmful

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

6 comments sorted by

9

u/imMute Jun 20 '15

I absolutely disagree with his indictment of --no-ff. The purpose of --no-ff (in GitFlow) is so you can do git log --first-parent ... on develop and see what features have been integrated, without being distracted by how those features were implemented. In fact, your release notes could be as simple as using that git log --first-parent ... with some extra options to pretty it up. Differentiating a group of commits that belong to a single feature is significantly easier when using --no-ff: just look at the two commit histories he presents. Looking at the second one, it's difficult to determine which commits were part of a specific feature.

I sort-of agree with him about the "master" branch (used for release commits merges only) is slightly redundant. Having that single branch makes having multiple minor releases out simultaneously impossible: ie, I release 1.0 now, then 2.0 some time later, then 1.1 & 2.1 after that (because I found a security bug that was hotfixed on both releases). OTOH, you could argue that having the release branch has the same advantages as develop/feature-* (like the --no-ff above) except for master/hotfix-*.

I hope I wasn't too critical of the author of GitFlow in this article. That certainly wasn't my intention.

A title of "$FOO considered harmful" seems pretty inflamatory to me. A better title (I think) would have been "A simpler alternative to GitFlow".

3

u/[deleted] Jun 20 '15

The purpose of --no-ff (in GitFlow) is so you can do git log --first-parent ... on develop and see what features have been integrated, without being distracted by how those features were implemented.

That makes little or no sense to me - can you point me to an actual git project that demonstrates this?

3

u/[deleted] Jun 19 '15

Just a difference of opinion on how things should flow. What works for him may not work for you. Personally, I like the Gitflow way and my company hasn't had any problems with it except for the occasional branch off/merge to the wrong main branch, but that's more of a PM/communication issue than a workflow issue. We absolutely need two main branches because we're always working on new features while QAing and fixing a release, and doing hotfixes for production.

2

u/[deleted] Jun 20 '15

I also disagree with "not having two branches" - after all, they cost you nothing - but his main emphasis is on the --no-ff flag, which I agree seems totally wrong to me.

1

u/[deleted] Jun 21 '15

Yeah I never used the no-ff flag

1

u/bamfg Jun 20 '15

How would you review a new feature if the commits are mixed in with every other piece of work going on at the same time? Or does the author advocate a single commit per feature/item of work?