r/programming • • Jun 19 '15

GitFlow considered harmful

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

244 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Jun 19 '15

[deleted]

-18

u/skinny85 Jun 19 '15

Or... I could just leave the branch there... Can you imagine trying to track the history of bugfixes for a release product if you're deleting the branch each time and just going off merges into master. Holy mary mother of god that sounds scary.

The tag tracks that history. Trust me, it's no problem at all.

BTW, I feel like you're resorting to "I'm no worse than GitFlow", but I've never used GitFlow so that's not compelling for me :/

I can just say, "Lucky you" :). I like to think my workflow is superior to GitFlow in every way - I'm not sure how I implied I'm merely no worse, that wasn't my intention.

0

u/[deleted] Jun 19 '15

[deleted]

12

u/Peaker Jun 19 '15

In git, branches and tags are essentially the same, except tags are supposed to be immutable and not move, whereas branches move.

So it sounds like re-creating a branch starting from that tag is merely a minor inconvenience?

0

u/[deleted] Jun 19 '15

[deleted]

10

u/Peaker Jun 19 '15

If you had a branch, it'd just equal the newest tag.

Tags aren't "inside" branches. Branches and tags are just pointers.

-2

u/skinny85 Jun 19 '15

If you already have v2.0.1 and v2.0.2 tags in your repo, then I'm at a loss as to what is that branch v2 for.

0

u/[deleted] Jun 19 '15

[deleted]

1

u/jdmulloy Jun 19 '15

That's in the history if you checkout the tag.

1

u/EntroperZero Jun 19 '15

I think the issue is that the history isn't separated from work that was done outside that branch. I don't think that's important, but it seems to be the complaint.

6

u/elperroborrachotoo Jun 19 '15

I don't know what the gitflow fuzz is about, and I prefer to "fix in develop, carry successful fixes to release branch".

Yet I don't see your problem either.

Let me try:

dev  ---> dev ------>  merge --> dev --->
  \-- 1.0 ---> {tag} --/

Oops! Bug in 1.0

dev  ---> dev ------>  merge --> dev --->
  \-- 1.0 ---> {tag} --/
                 \---- 1.1 ---> ...

4

u/ybrs Jun 19 '15
dev  ---> dev ------>  merge --> dev ---------->
  \-- 1.0 ---> {tag} --/                 /
                 \---- 1.1 ---> {tag} --/                          /
                                 \                               /
                                  \---------> 1.2 ---> {tag} --- /

vs.

dev  ---> dev ------>  merge --> dev --------------------->
    \-- 1.0 ------ / --- commit -- / -- commit bugfix -- /

i think what he means is the second one, having a linear branch is far easier to understand and use than having tags and re-creating branches etc.

if i can chime in, if you are developing an application (like an ios application etc) and need to bump version everytime it completely make sense, tags are like snapshots you cant change it, and when you release your software, you cant update without releasing a new version.

on the other hand, if you are building applications on the server side or (maybe web frontend), and deploy a dozen of times everyday, its a nightmare to tag and rebranch.

0

u/[deleted] Jun 19 '15

[deleted]

0

u/skinny85 Jun 19 '15

So your solution is to create a dozen of branches each day?

1

u/elperroborrachotoo Jun 19 '15

having a linear branch is far easier to understand

Yeah, sure, which is what I prefer. But hey, there must be a clever reason all those smart people don't do it that way... right? RIGHT?

I just wanted to illustrate how I understand the tag method.

→ More replies (3)

2

u/skinny85 Jun 19 '15

Yep, that's exactly how it works, and what I explained in the comment above.

1

u/killer_storm Jun 19 '15

No, it doesn't. Do I have to draw a picture?

The picture will look exactly the same due to the way git works (think linked list). It is just that creating/deleting this branch each time is absolutely pointless.

0

u/skinny85 Jun 19 '15

No, it doesn't. Do I have to draw a picture?

I'm going to recreate a new release branch every time I have to hotfix. And rather than having the linear history of that release channel, I have to go piece shit back together via tags.

I feel like you didn't even address what I said.

How do you perform a series of bugfixes for your shipped, v2 code, when your master is a hodge-podge of v2, v2 fixes and v3 code?

Easy. Say you want to do a fix in v2. You create a branch hotfix-2.1 starting at the commit pointed to by tag 2.0. You do your bugfixing on that branch. Meanwhile, work on v3 continues on master as normal. Once you're done, you tag the top of the hotfix branch, do the release, merge the hotfix to master, then delete the hotfix branch.

The method is exactly the same for further bugfixes to 2.1, except the names of the tag and the branch change of course.

I explained this already in the article and in the other Reddit thread.

0

u/[deleted] Jun 19 '15

[deleted]

→ More replies (1)

2

u/Cwiddy Jun 19 '15

I am not overly familiar with Git other than simple personal use (still in a SVN shop) but just to clarify for myself in get,

  • you can branch

  • do a bunch of things

  • tag the branch?

  • merge to master

  • delete branch.

So my questions are when you delete a branch you tag you still get the history to that tag, that is what you said above I think.

And then when you branch from a tag it has it's full history to that point?

0

u/[deleted] Jun 19 '15

[deleted]

4

u/fireflash38 Jun 19 '15

People are very angry that someone else's workflow is different than their own workflow.

-1

u/skinny85 Jun 19 '15

The difference is that tags are meant to be immutable, while branches are made to be changed. Not a big difference, but if someone makes a mistake, it might be the difference between "we can rollback to this safe version" and "I have no idea what was on production before we made the release :(".

→ More replies (1)

-1

u/skinny85 Jun 19 '15

Yes. A tag is a pointer to a specific commit. Obviously, every ancestor of that commit is reachable from that tag (that's what creates the history). A branch is just another pointer to a commit (with the difference being that is moves automatically when you create a new commit while on that branch, while tags are (conceptually at least) immutable), so it obviously sees the same history as the tag.

Does that explanation make any sense? :)