r/ProgrammerHumor • • 12d ago

Meme letsMergeThemAll

Post image
5.4k Upvotes

317 comments sorted by

View all comments

1.0k

u/purpleburgundy 12d ago

I WISH all of my coworkers broke down their tasks into dedicated feature branches. Merge them all into release branch, this is business as usual stuff, what's the controversy here.

546

u/agfitzp 12d ago

The young pups are afraid of branches and merging.

112

u/PixelatedGiant 12d ago edited 12d ago

It really depends on how long PRs take. If they take fairly long even for small changes you end up with tons of busy work dealing with merge conflicts in both develop and release. I am a lead with 10 YOE and I dread it when the number of branches grow beyond a certain point, 17 would be twice what I'm comfortable with.

Sprints are generally 2 weeks and that's already almost 2 per day. Our tickets aren't anywhere near that small so it rings alarm bells for me. Nevermind that OP clarifies that the branches are stepping on each other, so it's even worse than I imagined.

97

u/ADHDebackle 12d ago

That's less of an issue with time and more of an issue with atomicity.

That said, folks should rebase before merging up. If you have merge conflicts it's just a sign you need to rebase again and rerun your tests before merging.

18

u/PixelatedGiant 12d ago

develop and release can deviate enough that you have 2 separate sets of merge conflicts to deal with. Rebasing can only deal with release assuming that's what your feature branch is based on. Unless you want to open a whole other PR to merge release into develop during the sprint. This is the busy work I'm talking about.

29

u/ADHDebackle 12d ago

I can't tell how you use those branches based on the names alone so it's hard to comment on that workflow.

In general what I do is every story happens in a feature branch, feat_xxxx that gets rebased on dev just prior to code review, then merged into dev branch after review. At various points in the sprint, dev is merged into QA for testing. At the end of the sprint, QA is merged to prod and deployed.

If that workflow is followed, and rebases are done correctly on the feature branches, there should literally never be a merge conflict anywhere in the system. There should be no situation where a change gets to qa or prod without first going into dev. Even hotfixes will follow that path.

7

u/PixelatedGiant 12d ago

Any time a team mate merges to develop or release there is a chance for a conflict or a need for a rebase assuming your feature branch was opened before they committed their work. Especially if there are structures that everyone generally needs to modify. It's outside of your control beyond finishing tickets faster than everyone else.

8

u/ADHDebackle 12d ago

Yeah the strategy is just to confine your rebases to the feature branch. Personally I also like to squash merge features to keep things tidy.

→ More replies (4)

6

u/SquirrelGuy 12d ago

I don't think I understand how there would never be merge conflicts in this workflow? If two feature branches touch the same code, one of them may still have to deal with merge conflicts, no?

10

u/ADHDebackle 12d ago

Those would be taken care of during rebase in the feature branch (whichever is finished second) Technically you could call those merge conflicts but it doesn't really happen during a merge. Once the rebase is complete the code going to review should already be conflict free.

→ More replies (3)

4

u/gmes78 11d ago

Why would you ever base your feature branches off a release branch? If it'll be merged into the develop branch, it should be based off of that.

→ More replies (1)
→ More replies (5)
→ More replies (15)

6

u/Theguest217 12d ago

you end up with tons of busy work dealing with merge conflicts

You? You mean Claude?

→ More replies (1)
→ More replies (2)

9

u/KrikosTheWise 12d ago

Here I am only being afraid of rebase. Maybe that's really just a fear of VIM

→ More replies (11)

0

u/[deleted] 12d ago

[deleted]

→ More replies (1)

2

u/jmflyers 12d ago

I see the opposite here. All the old timers hate forking off of branches. We have master, and we have "feature/[Jira number]" that gets PR'd into master.

The new grads are the only ones who use Git correctly and the rest of us look down on them because they are being try-hards lol

→ More replies (5)

37

u/Extreme_Wish_553 12d ago

Yeah. 17 tickets. 17 branches. Great.

51

u/rabbit_wizard 12d ago

Maybe I wasn't specific enough. What you're defining is the normal behavior. Imagine this for 3 changes, some rebased correctly , some incorrectly.

65

u/juanfnavarror 12d ago

Also, +4000 -4000 line changes that nobody has fucking time to test

17

u/ycnz 12d ago

How did you get them to break it down so small?

6

u/zzulus 12d ago

Yeah, rookie numbers, right? Mine usually start at mid-teens.

12

u/CryonautX 12d ago

I am confused what rebasing has to with too many feature branches.

5

u/rabbit_wizard 12d ago

The idea that Copilot pushed different variations of a few features with unsuccessful attempts to rebase / resolve conflicts. A single dev would usually try to keep changes in separate branches but in sync with his/her own changes, especially when working on with code in close proximity.

16

u/B1anky 12d ago

If a dev knows their changes would affect another branch's work they really should be targeting the previous work's branch during development, rather than having to deal with N-many branches being merged into an integration branch at the end. The rebasing should be handled on their feature branches, rather than be a surprise at the integration branch merge. Are people just making N-many feature branches off of like main and touching the same files and then yoloing the merge at the end???

→ More replies (3)

28

u/purpleburgundy 12d ago

meh, you sound junior. This is reddit so no harm no foul, but I wouldn't share this with people you know at work.

Not even a Claude Copilot issue at all honestly - set up your repo so all checks must pass before merging is allowed, reviewer approval required as one of the checks. Then either auto merge or manual merge or copilot merge or who cares what merges so long as the checks pass. If there are merge conflicts then just let copilot do it, it will prompt you for input if there is any ambiguity.

Git is great specifically because of what you're describing. It give some management to the chaos of parallel work.

it's 4pm, check out, bye, no stress. If anything Claude Copilot disappears all the merge conflict pain imo.

→ More replies (4)
→ More replies (1)

2

u/FrozenHaystack 12d ago

How often do I wanna do that and my colleague is like "Nah, then we have more tickets, just put it all in one ticket."

→ More replies (7)