Sorry, I thought we'd switched contexts from your article to git in general when you started trying to teach me how git works.
Let me try explaining my point of view a different way. Lets follow your tagging example.
I have a client. I make a build of my software for them. I tag the release c1-v1 for client 1 version 1. I continue my development in a branch somewhere.
The client comes back and needs a bug fixed. I stop what I'm doing, git checkout c1-v1, make whatever changes I need to make, create a new commit on top of the tagged commit, git tag -a c1-v2, and release that to the client. Another bug comes up, c1-v3, and then c1-v4.
I believe this is following your model correctly. My development is taking place in a branch somewhere, and every release I've given to a client is tagged with no branch associated with it. If I repeat the process for 10 hot fixes over 10 different clients, that's 100 tags. They're all nicely named, so I can run git tag -l and look through the list to see what the largest version for c1 is and so on.
This has the advantage that the client can say "I'm running c1-v16" and you can instantly type that into a git checkout command and be where the client is. That's great.
But if you look back at what you're naming your tags, you'll see that all of the client tags start with c1, and they're all in a row, and you're always adding new commits onto whatever the latest c1 tag was. It's almost like c1 is a branch name. You're manually advancing HEAD on your branchless branch each time you create a new commit and tag it, while a real branch does this automatically. You can push and pull branches, but doing that with your branchless branch is more difficult. Tools that deal with revision history, like those fancy graphs you have screenshots of, will have a tag and a commit message for every single commit, and some of them won't draw any pretty lines for it that, as I mentioned elsewhere, are actually fairly convenient for tracking logically grouped changes in a codebase.
I believe I understand what you're proposing, and it has advantages, and maybe it's a good fit for some development situations. I personally don't think it fits my needs very well.
I think I know what you're getting at. This is the case when you need to maintain completely separate versions of your project (in your case, for different clients). Somebody mentioned that in the comments of the article already.
I would agree that branches are better in that case, but that's not really GitFlow anymore, so the article doesn't really deal with that topic. In my mind, this is a difficult thing to do properly no matter what method you use.
And the tag benefit over a branch is obvious - you can rollback to a tag. In your example, with a branch, you lose the history of your client's versions. In the case you described, it's pretty obvious that you don't need that history, and that's why a branch is better for you.
I disagree, that's exactly GitFlow. GitFlow is designed to make it easy to support multiple different released versions of the software simultaneously. They're not completely separate, they're different versions of the same product. In my example I had used the word client to make it easier to distinguish using "c", but don't let that cloud the issue. I'm talking about multiple, related, simultaneously supported versions of a single product.
you can rollback to a tag
You can get your working directory to the state of any commit you want by specifying the hash. Git log is going to list them in the order they were produced, and I can always checkout HEAD again to get back to the latest incarnation of a particular version. Nothing is "lost" except the ability to specify a commit by a friendly name instead of a complicated hex value. You seem to have a good grasp of git, so I have to assume you understand this basic principle, and as such I have no idea what you're trying to convey with that paragraph.
Anyway, it's been interesting debating it with you, thanks for the mental exercise :)
You can get your working directory to the state of any commit you want by specifying the hash. Git log is going to list them in the order they were produced, and I can always checkout HEAD again to get back to the latest incarnation of a particular version. Nothing is "lost" except the ability to specify a commit by a friendly name instead of a complicated hex value. You seem to have a good grasp of git, so I have to assume you understand this basic principle, and as such I have no idea what you're trying to convey with that paragraph.
Yes, I realize that. The problem is that without tags, you have no idea which of the (potentially very many) commits on branch c1 built the software that your client C1 was using at past points in time. Like I said, this is not something that you care about when you gave the example (you only care about the newest version), and that's the reason that those tags don't make sense to you.
I guess you could version your software with the commit hash, but I'm not sure your clients would be too thrilled about that :).
Anyway, it's been interesting debating it with you, thanks for the mental exercise :)
16
u/[deleted] Jun 19 '15
Sorry, I thought we'd switched contexts from your article to git in general when you started trying to teach me how git works.
Let me try explaining my point of view a different way. Lets follow your tagging example.
I have a client. I make a build of my software for them. I tag the release
c1-v1for client 1 version 1. I continue my development in a branch somewhere.The client comes back and needs a bug fixed. I stop what I'm doing,
git checkout c1-v1, make whatever changes I need to make, create a new commit on top of the tagged commit,git tag -a c1-v2, and release that to the client. Another bug comes up,c1-v3, and thenc1-v4.I believe this is following your model correctly. My development is taking place in a branch somewhere, and every release I've given to a client is tagged with no branch associated with it. If I repeat the process for 10 hot fixes over 10 different clients, that's 100 tags. They're all nicely named, so I can run
git tag -land look through the list to see what the largest version for c1 is and so on.This has the advantage that the client can say "I'm running c1-v16" and you can instantly type that into a git checkout command and be where the client is. That's great.
But if you look back at what you're naming your tags, you'll see that all of the client tags start with c1, and they're all in a row, and you're always adding new commits onto whatever the latest c1 tag was. It's almost like c1 is a branch name. You're manually advancing HEAD on your branchless branch each time you create a new commit and tag it, while a real branch does this automatically. You can push and pull branches, but doing that with your branchless branch is more difficult. Tools that deal with revision history, like those fancy graphs you have screenshots of, will have a tag and a commit message for every single commit, and some of them won't draw any pretty lines for it that, as I mentioned elsewhere, are actually fairly convenient for tracking logically grouped changes in a codebase.
I believe I understand what you're proposing, and it has advantages, and maybe it's a good fit for some development situations. I personally don't think it fits my needs very well.