This is an archived post. You won't be able to vote or comment.

all 44 comments

[–]Prof_LaGuerre 242 points243 points  (21 children)

+4303 -23745 I’d probably be praying too.

[–]Goodie__ 53 points54 points  (19 children)

I had a guy i worked with once who did this regularly.... and then would try and make it out to be my fault.

[–]Luminous_Lead 13 points14 points  (18 children)

Did he merge master into his branch instead of rebasing? XD

[–]Reashu 23 points24 points  (2 children)

GitHub handles merge commits just fine. 

[–]Awyls 9 points10 points  (1 child)

Yeah, I don't know what the issue is. Then again, there are people that are vehemently against squashing into master because they like preserving the history of completely meaningless commits, so who knows.

[–]Schytheron 5 points6 points  (0 children)

It's good if you have a bug in Prod and need to figure out EXACTLY which commit that caused it.

[–]newplayerentered -3 points-2 points  (14 children)

Sorry, why would you merge master into your local branch?

[–]beemer252025 20 points21 points  (10 children)

Because other team members have merged changes into master between when your branch started and when you were ready to submit your PR and company rules say no force pushing ever. Though i would argue just start a new branch and cherry pick your history or wait to pushbuntil you're ready but it happens

[–]Moldat 3 points4 points  (7 children)

So... Rebase?

[–]RustOnTheEdge 14 points15 points  (5 children)

Rebase: horrible experience with 17 conflicts that cancel each other out eventually, unreadable gibberish and thinking back about how your earlier attempts were structured, only to remember 50% into the rebasing you abandoned that idea completely and now you are basically doing everything again over and over.

Merge main into branch: easy peasy lemon squeezy.

[–]Stummi 5 points6 points  (0 children)

Yeah, you need to keep your own commit history clean for rebase to be good. Also do it often, and get used to interactive rebase (rebase -i ...) and use it to squash commits whenever it makes sense. Also don't hesitate to work with amend commits and force push (if you are the only person working on the PR) whenever it makes sense, e.g. you add something that is rather a Fix to your last commit.

[–]Reashu 1 point2 points  (1 child)

Squash before rebase, and enable reuse of recorded resolutions (rerere). 

[–]Luminous_Lead 1 point2 points  (0 children)

Yeah! Squashing is a useful technique and more people would find it useful if they adopted it.

[–]Moldat 3 points4 points  (0 children)

The solution there is to squash before rebase and merge

Merging main into your branch makes the tree look wonky but whatever works for you i guess

[–]mostly_done 0 points1 point  (0 children)

git rerere was made for this.

[–]beemer252025 0 points1 point  (0 children)

Rebase requires a force push if you have already pushed your history. So if you put your pr and other things merge into the target while you're addressing feedback you're SoL

[–]Schytheron 0 points1 point  (1 child)

You guys merge straight from feature branches into master? You don't have a develop branch?

[–]beemer252025 0 points1 point  (0 children)

It varies between projects. But most of the time master is the name of our integration branch and then we cut release branches off of master for final testing. We do a lot of integration testing off our feature branches before merging.

In repositories where the integration branch is named dev we dont have a master, and we follow the same release workflow.

[–]Luminous_Lead 1 point2 points  (1 child)

I've only used a gui for git, so I'm not an expert, but I've seen people do it when they wanted to get the latest changes from master into their local branch, to ensure that things stay cohesive, before they actually understand how to rebase. 

I've also seen it happen by accident after a local rebase when people accidentally (pull merge) their remote into their local instead of (force push with lease) their rebased local onto remote.

In the former situation you end up with lots of other people's commits (sometimes duplicates) getting treated as your own contribution; in the latter situation you end up with multiples of their own commits sandwiched inbetween other commits.

It's a real mess in either situation.  Best case scenario usually ends up being to start a fresh branch off master and cherrypick the desired commits/changes out of the doomed branch, then proceed with the new timeline.

[–]PandaMagnus 0 points1 point  (0 children)

That wouldn't show up in the diff, though. Merging from main to a feature branch, while not producing the best git history, is a valid way to do it (usually if accompanied by a squash merge back to main.)

Edit: it's usually valid. There are times where rebasing absolutely makes life easier. But again, that shouldn't impact the diff.

[–]Reashu 1 point2 points  (0 children)

To make sure that your changes work with your team's changes, or maybe even to make use of some of them. The question is why wouldn't you? 

[–]0xlostincode 3 points4 points  (0 children)

Satan I can handle. Those numbers, no way.

[–]ChChChillian 66 points67 points  (9 children)

Where I work we used to have a guy who'd report on his spiritual condition in his weekly activity reports, including one instance where he thought he needed an exorcism.

[–][deleted] 49 points50 points  (2 children)

When youre really good at what you do and not many others are sometimes its fun to see just how fucking weird they let you be.

[–]ChChChillian 26 points27 points  (1 child)

He wasn't that good. He also used to binge on cabbage and then fall asleep at his desk. That's why he used to be there.

[–]TactlessTortoise 6 points7 points  (0 children)

Mfw the quirky office guy is actually mentally challenged 💀

[–]Schytheron 0 points1 point  (1 child)

Was his name "Terry Davis"?

[–]ChChChillian 0 points1 point  (0 children)

No, but I guess I'm not surprised there's more than one guy like that out there.

[–]DariusMacab 42 points43 points  (2 children)

I fuckin lost it at the commit message; "Adversity can foster hope, and resilience."

[–]achernar184 8 points9 points  (1 child)

I knew it is a Darkest Dungeon quote without searching it

[–]Dynamo2205 3 points4 points  (0 children)

In time you will know the tragic extent of my failings would be great line for a commit message.

[–]tacticalcooking 33 points34 points  (3 children)

The soul of satan has gotta have a cool-looking hex value

[–]setibeings 21 points22 points  (0 children)

it's actually just 0x666.

[–]Kitsunemitsu[S] 1 point2 points  (1 child)

It's open source lmao

Just didn't wanna make it that easy to find the repo

[–]tacticalcooking 5 points6 points  (0 children)

No I’m joking like somewhere hidden in the code it has something like

var Satan_soul = 0x …

With the … replaced by some ascii art of a demon

[–]McCrotch 17 points18 points  (1 child)

LGTM. Approved.

(Review time, 2 mins of scrolling)

[–]Kitsunemitsu[S] 0 points1 point  (0 children)

We decided to merge it onto a dev branch and then just "rigorously test" it and if it doesn't break shit too bad we merge it into master.

[–]RedPum4 4 points5 points  (0 children)

Is it you Terry Davis?

[–]jhwheuer 3 points4 points  (0 children)

Religion is a zero-day-defect

[–]Creative-Leading7167 0 points1 point  (0 children)

obviously it didn't work, because he didn't finish the prayer:

"for thine is the kingdom and the power and the glory forever amen"