by silasdb on 6/24/20, 12:00 AM with 112 comments
by dastx on 6/24/20, 7:11 AM
This combined with semver gets you far. I've yet to find any downsides with this approach.
by wcarss on 6/24/20, 1:54 AM
One of the key elements of trunk flow that I value about it is that "the software you released" is not a living stream. Because of that, it should not be tracked by a long-lived branch with commits that flow in in over time except in rare fix situations. With trunk flow and similar styles, you can always merge to master, and you can always deploy master. You do so by cutting a new branch, and in my opinion, you then build a static artifact. Next time you deploy, you cut another branch, build your artifact, and put it somewhere.
Need to do a hotfix, but there's other work since last release that you just can't ship? Cherry-pick onto the currently-deployed release branch, not onto some long-lived production branch. There's no weird merge-backs, no strange no-op commits in a long-lived history.
trunk-flow is also very simple. For these and other reasons, it's great.
And, some key points about building static deployment artifacts: if you build an artifact to deploy at merge-time to master, you can avoid having your production servers download and execute code for you. You can test your exact artifact before you ever send it to production. You can reproduce your builds. Left-pad-like library unavailability issues can't hit between staging and production. Deployments to production are very fast. You can keep a few artifacts around and roll back quickly and reliably to working states (barring database stuff!). You can deploy two versions to different userbases at the same time. It's very useful. :)
by jdlshore on 6/24/20, 3:58 AM
by viraptor on 6/24/20, 5:09 AM
Some projects need release branches, some projects use continuous deployment, some projects need manual QA, etc. There is no solution that will work for everyone, so unless your flow description starts with assumptions and matching requirements, it's wrong. (for some people reading about it)
by dragonwriter on 6/24/20, 7:15 AM
Should be titled “The sales pitch for GitLab Flow”.
by danw1979 on 6/24/20, 7:49 AM
No it doesn’t.
> Another frustrating aspect is hotfix and release branches
I beg to differ.
I know what would be frustrating though:
> GitLab Flow is a way to make the relationship between the code and the issue tracker more transparent. Each change to the codebase starts with an issue in the issue tracking system.
... tying my repo to one particular git hosting platform.
by sn1de on 6/24/20, 5:28 AM
by servilio on 6/24/20, 6:07 AM
> Git flow forces developers to use the develop branch rather than the master. Because most tools default to using the master, there’s a significant amount of branch switching involved.
I'd like to see this fleshed out, since whatever branch naming convention or roles you use, you will be switching the same amount.
> Another frustrating aspect is hotfix and release branches, which are overkill for most organizations and completely unnecessary in companies practicing continuous delivery.
Yes and no. If you don't separate master from develop, hotfix branches just work like feature branches. But if you need them separated, then...
> Bug fixes/hot fix patches are cherry-picked from master
Avoid doing this, use daggy fixes[1], and it will make it breeze to check that a fix was actually merged and where[2]. And if you do cherry pick, at least use "-x".
[1] https://wiki.monotone.ca/DaggyFixes
[2] git branch --contains <commit>
by bredren on 6/24/20, 1:49 AM
The problem of not easily linking feature branch names to issues is real, though I have been solving this using:
`[issue id]/feature-or-issue-title-abbreviated`
And while you don’t get nice hyperlinking from the branch references on GitHub—-and it’s possible for the issue title to be out of sync with the feature branch name at times, it isn’t too bad and I don’t often need to go back and look at a feature branch.
Perhaps projects with bigger teams this is more important and the linking / strong issue attribution to the branches is more meaningful.
I’m less clear on the removal `develop`. It makes more sense to me to use master as this serious “released” state. And for develop to be a bit more loose.
More importantly, I typically will run `develop` on a staging instance. So it’s pretty important to me.
I still do testing on ‘develop’ and feature branches before they are merged. I also don’t feel like the start / finish release process is all that onerous.
From a commercial standpoint, I’m not a huge fan of tossing GitLab into the concept name. It’s a little brand-y on something that just doesn’t need it.
by ablanco on 6/24/20, 4:43 AM
I use git-flow on projects that need to be installed by various different clients and there's no way to force all of them to migrate to the latest version, so you have to maintain support for older releases.
When the software needs to be installed in a single place and you can do it with CI/CD theres no need for the git-flow complexity.
by ramenmeal on 6/24/20, 6:15 AM
edit: I'd rather trunk based w/ tagging commits for releases.
by somewhereoutth on 6/24/20, 2:38 PM
Easy enough to write a wrapper around git to do this - I am tempted.
by polymeris on 6/24/20, 12:47 PM
The most important learning for me was that things like Git Flow aren't free: they slow you down and make developers feel more detached and less responsible for the code that's running in prod.
[1] https://circleci.com/blog/you-are-what-you-git-how-your-vcs-...
by alkonaut on 6/24/20, 12:31 PM
> The production branch is essentially a monolith – a single long-running production release
It assumes that only one version is deployed at a time, so you can't really service version1.0 after you shipped version2.0.
Having multiple independent maintenance branches for production is critical for any branch pattern that should apply to both web software (normally single deployed version) and e.g. Desktop (normally multiple deployed versions).
Th
by steve_taylor on 6/24/20, 2:01 PM
This smells like GitLab trying to increase its ownership of the ecosystem.
by tupac_speedrap on 6/24/20, 10:44 AM
If you used a system with less use of branches you'd just end up with dodgy code in master instead.
by jjuel on 6/24/20, 3:04 PM
by einpoklum on 6/27/20, 9:13 AM
That means that you can safely "git pull" the master branch, always, into the future, but if you try to pull the development branch, you may well fail.
by somewhereoutth on 6/24/20, 12:40 PM
Pushes and pulls can then be visualized as two such shrubs reconciling themselves.
by rob74 on 6/24/20, 12:47 PM
by pronoiac on 6/24/20, 1:29 AM
That gave me pause; I'm used to relatively small commits, for easier review and verification, so that seemed too much. Reading the link, I think they mean, run tests on every branch on every push.
by sebazzz on 6/24/20, 4:54 AM
by thisisastopsign on 6/24/20, 1:49 PM
by king_magic on 6/24/20, 2:05 PM
by WWLink on 6/24/20, 5:57 AM
by hellofunk on 6/24/20, 9:56 AM
by malinens on 6/24/20, 2:21 PM
I still enjoy working with gitlab but this annoys me very much
by 0x00101010 on 6/24/20, 12:14 PM
by renewiltord on 6/24/20, 7:15 AM
Git workflows are over-engineering.