this post was submitted on 03 Jul 2023
36 points (92.9% liked)

Programming

17450 readers
166 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] solidsnail@programming.dev 5 points 1 year ago (2 children)

Regarding section 1, won't you still get the conflicts when pushing to remote (or pulling from it)?

[–] jim@programming.dev 7 points 1 year ago (1 children)

Precisely. In practice, trunk based development just means your branch is local instead of on remote.

[–] glad_cat@lemmy.sdf.org 1 points 1 year ago (1 children)

What do you mean by local? git can hide merges or feature branches, and you have to save your temporary code by pushing it to the server at the end of the day. You can rebase your code or squash it before merging, but TBD is not talking about that IIRC.

[–] jim@programming.dev 2 points 1 year ago (1 children)

If the work I'm doing is on a feature branch on remote or locally, why does it matter to the rest of the team? My integration steps can be done on a server instead of locally. TBD forces teams to collaborate synchronously since changes are pushed straight to trunk. Rebase or squashes are irrelevant here.

Another poster put it great: TBD is trying to solve a culture problem. Feature branches and pull requests into main is much more flexible. The only time TBD make sense is for small teams - like 2 or maybe 3. And even at 2, I'd much rather create feature branches that merge into main.

[–] glad_cat@lemmy.sdf.org 1 points 1 year ago* (last edited 1 year ago)

TBD forces teams to collaborate synchronously since changes are pushed straight to trunk

The main page about TBD says you can still use feature branches, merge requests, or squash/rebase, and that's how I use it. It only says why and how you should use release branches, and how you should fix bugs in a release. The linked article is not talking about TBD at all, hence my confusion about this whole post.

[–] glad_cat@lemmy.sdf.org 4 points 1 year ago* (last edited 1 year ago)

I'm actually confused by the whole post.

In contrast, the branching model

TBD is a branching model which works fine with DVCS. I've used it successfully with git and it was better than the other "git/github flows."

The point of TBD is to have well-defined branches for certain tasks or topics. Nothing is forced for how you achieve this. For example you won't get conflicts if you have a rule to merge the master/develop/main branch, or squash or rebase your commits on your feature branch before your merge request is ready.

Also, I disagree with the person who says it's a "developer culture problem." IMHO it's a branching model that should be respected in the same way we have rules for code formatting or using linters before a commit whether it's a tool, a hook, or a check in the CI.

Overall I prefer TBD because it has fewer branches than the other methods.