b0rk, (edited )
@b0rk@jvns.ca avatar

working on sketching a few different git workflows I've seen people use. what am I missing?

(I'm less interested in minor variations on these like how you manage tags or the exact details of how the feature branches work and more interested in completely different workflows)

msokolov,
@msokolov@fosstodon.org avatar

@b0rk sometimes I am working on a big thing and I want to break it up for easier review/ testing/ sharing so I have feature branch xxxx and then feature branch xxxx+yyyy that depends on xxxx. I want this to work but it inevitably leads to rebase hell

whynothugo,
@whynothugo@fosstodon.org avatar

@b0rk The "we all send patches to a single list and the maintainer merges them into the main branch" flow is missing. It probaby wouldn't scale to something as big as the Linux kernel, but most projects never have to worry about "too many contributors".

sima, (edited )
@sima@chaos.social avatar

@b0rk the linux kernel is kinda the first three plus the release branch model, for that reason I tend to call the abstract model the "monotree with multiple repos" approach to git

one that I think you're missing is the multi-repo approach, where you have a pile of git repos (each can work with one of the other models), and then an integration repo that links it all together and picks specific versions of each component. android works like that, and git supports this flow with git submodule

dakira,
@dakira@chaos.social avatar

@b0rk we use one of these:

  • feature branches with main having stable code plus env branches that merge from main to deploy to those envs
  • feature branches plus tags to steer deployment/builds (tag on main == release).
gnomon,
@gnomon@mastodon.social avatar

@b0rk

  1. Branch called "master" with no commits more recent than 2018, date of the most recent "codebase unification" mandate

  2. Two or three "managed" branches per unique variant of product running the codebase

  3. Feature branches stem from managed branches, are merged in order of feature ticket closure into "verification" branches

  4. Verification branches are merged into managed branches a few times a year

  5. Ad hoc project-halting disaster merges to copy features between product branches

funes,

@b0rk I was just looking for this sort of information today and these diagrams are already super helpful

claudius,
@claudius@darmstadt.social avatar

@b0rk the pro git book has good visualisations, I think. https://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows

pulkomandy,
@pulkomandy@mastodon.tetaneutral.net avatar

@b0rk that view of Linux development model is simplified too much I think, it is an interesting case of "vendor branches" where someone (a CPU or device manufacturer) will maintain their own version of Linux with patches to support their own hardware, and s%nchronize with upstream Linux (by merde or rebase) from time to time

This exists in other projects as well, for example I worked on several private forks of wireshark adding custom protocols to it this way, gcc branches to add a new CPU, …

b0rk,
@b0rk@jvns.ca avatar

lots of great replies to this one. I think the main missing workflow from those 4 is a "release branches" workflow something like this

ScriptFanix,
@ScriptFanix@maly.io avatar

@b0rk It misses "backport to community? backport to enterprise?"

mrbn,

@b0rk I'm a little confused, release branches fall behind the dev branch so wouldn't the timeline look like [dev] <- [release 2] <- [release 1]? Hotfixes would be merged into dev and [release X] with feature branches only merging dev back in periodically?

erikp,

@b0rk I would argue that this is a detail of the feature branch modell

oiffrig,
@oiffrig@framapiaf.org avatar

@b0rk There's a good article describing one such workflow: https://nvie.com/posts/a-successful-git-branching-model/

das_g,
@das_g@chaos.social avatar

@b0rk The Linux kernel model calls them "subsystem maintainers", not "subdirectory maintainers". https://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows calls them "lieutenants".

b0rk,
@b0rk@jvns.ca avatar

@das_g thanks, I couldn't remember what they were called

bookwar,
@bookwar@fosstodon.org avatar

@b0rk it is a bit puzzling to me why people consider sending patches over email something special, and not a form of a feature branch workflow.

You have a target branch, you have a local branch. You are sending the diff between those branches for review.

It is only a wrapping, the packaging you use to deliver the diff, which is different, isn't it?

elricofmelnibone,
@elricofmelnibone@mastodon.social avatar

@b0rk Something I've encountered quite a few times: Feature branches + long lived version branches. The version branches get bugfixes and patch releases. Occasionally also new features (🤮). Older versions with fixes might be merged into newer versions.

b0rk,
@b0rk@jvns.ca avatar
elricofmelnibone,
@elricofmelnibone@mastodon.social avatar

@b0rk It can lead to difficult merge conflicts, but customers in some industries really hate change, and this is one way to protect them from change as much as possible.

jedbrown,
@jedbrown@hachyderm.io avatar

@b0rk gitworkflows(7) is related to panel 4, but unique in that 'next' is discarded after every release. It's a good model when your automated test suite is incomplete so you need a way to get user testing on things before they graduate to main. https://git-scm.com/docs/gitworkflows

igrok,

@b0rk git.git has a branch it rewrites frequently that merges together all the proposed changes to its main branch, for review & testing ("seen")

It also has a completely unrelated branch (no common ancestor with the main branch) ("todo") with release notes and info about known branches in progress

It has also merged with outside projects and thus has multiple root commits (Git has 7 from the master branch)

Alexbbrown,
@Alexbbrown@hachyderm.io avatar

@b0rk release branches which get new features which are forwarded to newer release branches and then main

https://confluence.atlassian.com/bitbucketserver/cascading-merge-776639993.html

ednl,
@ednl@mastodon.social avatar

@b0rk Just writing in support of including the "all to/from main, tiny project" version. This may be a perversion of the git system but it is by far & away the most common use of it for me, where I am all three users consecutively: on my dev box, testing server, laptop.

b0rk,
@b0rk@jvns.ca avatar

@ednl yes same! I don't think it's a perversion, it's so simple and Git works really well in that use case

hrw,
@hrw@society.oftrolls.com avatar

@b0rk I am missing picture when feature branch is created, sent as PR and then rewritten again and again, over and over.

I had several such ones. My own projects get several "git push -f" branches in pull requests.

mwop,
@mwop@phpc.social avatar

@b0rk For most projects I'm on, we do release branches only - e.g., 0.1.x, 1.2.x, 2.3.x. We tag from these, and create a new release branch for next minor or next major when we want to land new features or BC-breaking changes.

This has another benefit: we target security fixes at the oldest supported release branch, and then merge up, tagging as we go. This tends to be easier than backporting patches.

jeffomatic,

@b0rk The last few cos I worked at were cloud startups whose products you’ve probably used, and they used pretty much the same flow: same as your GitHub-based feature branch workflow, but release branches are cut from the tip of main shortly before deploys to each environment (staging, prod, etc). This is mostly to ensure that you can do hotfix cherry picks if something breaks. Since all environments are cutting from main, the gap between staging and prod is generally pretty limited.

fbartho,
@fbartho@mastodon.social avatar

@b0rk Long-lived Forks that occasionally sync up, or push features upstream.

You could think of them like feature branches, but… it’s a lot more complicated.

bignose,
@bignose@fosstodon.org avatar

As with others, @b0rk I really need the diagram to be much clearer that

  • This is about commits in a single repository (or is it?)
  • Most workflows also depend on differentiating which repo (local; personal fork remote; upstream remote; etc.) we're committing to

Probably this means tackling "branches in your local repo" as a clearly distinct topic from "the set of repos your team will variously use".

esg,
@esg@hachyderm.io avatar

@b0rk trunk based (everyone pushes to main) isn't that uncommon for teams with solid ci/cd practices, even on larger projects

yorgos,

@b0rk maybe a missing one is git's fully decentralized flow.

(i.e. no assumption of one main branch or central repo - just peers' individual views of the world ) ?

b0rk,
@b0rk@jvns.ca avatar

@yorgos have you worked on any projects that do that?

yorgos,

@b0rk it's the peer-to-peer topology that all projects on @radicle have (because it's not a centralized forge) , so I'm a little biased... 🙃

b0rk,
@b0rk@jvns.ca avatar

@yorgos @radicle that's really cool! i'm more curious about the social structure of a totally decentralized project than the technical structure though -- like I can't think of any projects that don't have a “main" central distribution

(like I'm sure lots of organizations maintain forks of the linux kernel, but I wouldn't say that they're peers of the official releases)

yorgos,

@b0rk @radicle yes, I think there is always a need for a “canonical” main, so new users don’t have to fully grasp the governance model in order to read the code / contribute.

By “governance model” I basically mean the workflow process by which code gets merged to the canonical main branch.

Technical differences of a p2p network like aside, I think the same social structure is in projects that request X reviewers (from Y different orgs) to approve before merge.

landley,
@landley@mstdn.jp avatar

@b0rk Everybody sends me patches on the mailing list, in "git format-patch" format if they want metadata, and when they do a GitHub pull request instead I add ".patch" to the pull request URL and wget it. Then I "git am" it locally.

I believe my repository has one accidental merge in it something like 8 years ago.

ilikepi,

@b0rk I think your "big team" has several variants based on:

  • rebase or merge to get updates into feature branch
  • squash before merge or not
  • keep merge commits or not

But if you're trying to stay high-level, they're all encompasses by your "big team" graphic.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • ethstaker
  • DreamBathrooms
  • InstantRegret
  • tacticalgear
  • magazineikmin
  • Youngstown
  • thenastyranch
  • mdbf
  • slotface
  • rosin
  • modclub
  • kavyap
  • cubers
  • osvaldo12
  • JUstTest
  • khanakhh
  • cisconetworking
  • Durango
  • everett
  • ngwrru68w68
  • Leos
  • normalnudes
  • GTA5RPClips
  • tester
  • anitta
  • provamag3
  • megavids
  • lostlight
  • All magazines