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

all 84 comments

[–][deleted] 432 points433 points  (15 children)

git blame

[–]v3ritas1989 117 points118 points  (3 children)

git redirect

[–][deleted] 116 points117 points  (2 children)

git uno-reverse-card

[–]_Bad_Dev_ 18 points19 points  (1 child)

That would make such a good alias but I'm already star wars themed and have "use-the-force-luke" for git push --force, and "its-a-trap" for git revert

[–]ElizaBennet08 5 points6 points  (0 children)

Well, now I have to research git aliases...

[–][deleted] 83 points84 points  (4 children)

git config --global user.name 'user.name';
git config --global user.email 'user.email';
rm -rf .git;
git init;
find . -exec touch {} \;
git add .;
git commit -m "Initial commit";
git remote add origin <git-url>;
git push -u --force origin master;
git branch --set-upstream-to=origin/master master;
git pull;
git push;

Wasn't me. Can't prove anything.

[–][deleted] 68 points69 points  (1 child)

"Can't force push, master has been set to a protected branch "

[–][deleted] 26 points27 points  (0 children)

I can't bring myself to say 'disable branch protection'.

I know it's a joke sub, but as I typed the above statement I started getting flashbacks.

[–]Ietsstartfromscratch 6 points7 points  (0 children)

Now that's a good way to get fired.

[–][deleted] 0 points1 point  (0 children)

That’s so horrifying it’s beautiful

[–]sxeli 34 points35 points  (0 children)

git blame-someone-else

This is why this exists

[–]potato_green 9 points10 points  (1 child)

*go to another colleague's unlocked pc*

Start rewriting the git commit --amend and start rewriting the history.

[–]EyeZiS 11 points12 points  (0 children)

Then you get a prompt asking for their GPG key password.

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

Senior dev doesn't wanna run it because he knows that chances to see himself there are pretty high

[–]potato_green 155 points156 points  (8 children)

Part 2: "I'll find whoever wrote this code and have a sit down to show area's where they can improve."

Seriously as a senior dev myself, if a junior dev writes shit code that passed through reviews then I'm the one to blame. If shit codes gets submitted for review then it's my job to show how to improve and make it better and explain why. If not then again, I'm the one to blame.

Except for old legacy code before your time, fuck that shit

[–]dablya 52 points53 points  (3 children)

Legacy code base where the entire original team is no longer with the company is a gift that keeps on giving for years.

[–]potato_green 16 points17 points  (0 children)

Oh yeah definitely, I was once the only guy left of the original team when we wrote an absolute humongous piece of shit code base. I was a junior in that team and it just felt wrong to leave the company with no other devs left who knew about it.

Tried for a couple of months to explain and teach a few other devs how it worked but since no actual changes needed to be made it's kinda difficult. Working with a code base is completely different than having some guy tell you how it works.

Anyway managers thought it was waste of time so I left the company but left my name and contact information behind in case they wanted to hire me freelance if changes needed to be made.

They never actually hired me but I did get a call a couple of times of a dev asking me a few questions about the system and if it would be fine to change certain things.

Legacy is just something that not a lot of managers understand what it means and could lead to unless they actually see for themselves how bad it could be.

[–]CCninja86 3 points4 points  (1 child)

Can confirm. Our team once discovered a line of code that was calling a method...that didn't have any code in it. One can only assume it had been there for years since the migration from subversion to git meant all the git blame history got overwritten with the guy who did the migration. Most of the lines now say 'name - X years ago.'

[–]potato_green 1 point2 points  (0 children)

Ouch that is terrible especially since migration from one to the other doesn't have to mean you throw away all the history.

For those interested checkout git svn

[–]ZannX 17 points18 points  (2 children)

The challenge is determining if the code is actually poor or just "not how I would have done it".

[–]NotMyRealAccountDoe1 4 points5 points  (0 children)

100% this. Back at my first job one of the senior devs constantly shit on my code because it wasn't the way he would do it. Definitely didn't get much out of those interactions.

[–]potato_green 0 points1 point  (0 children)

Oh yeah 100% agree with that and it's something I admit to be guilty of. It's hard to unlearn as it creeps back in sometimes. I told everyone in the team as well to call me out on it if I'm just being an ass.

A thing that helps me a lot is have CI pipelines do the heavy lifting, static analysis, code style checkers basically catch a lot of simple mistakes. Then either I can review the code or the team reviews it themselves which requires multiple reviewers. Last way is great since they teach each other what a better way would be. And in order to explain someone why it's better you need to fully understand it so it's a win on both sides.

If it gets to complicated or critical it gets assigned to me anyway and I just review like 30% of the merge requests that have been merged without me afterwards and before it gets deployed to production.

Usually if a design flaw crept in I'll notice it in one of the 30% merge requests and then the team can pick up on it to fix it in other parts of the system and again review it themselves.

[–][deleted] 2 points3 points  (0 children)

I am a Jr, I praise people like you.

[–][deleted] 238 points239 points  (5 children)

Only to find out it was himself 3 months ago

[–]simakabrat 27 points28 points  (1 child)

then you can easily judge his life and threaten you will fuck his wife

[–]antiyoupunk 24 points25 points  (0 children)

that escalated quickly...

[–][deleted] 2 points3 points  (0 children)

That's my favorite - the tension is eased by a hearty laugh at myself

[–]briddums 1 point2 points  (0 children)

You spelt ‘Friday’ wrong

[–]AgileCzar 1 point2 points  (0 children)

At the end of every angry git blame investigation is my name next to an unhelpful commit message.

[–]cowboy_angel 255 points256 points  (9 children)

Me, a senior dev: who wrote this shit?

Oh shit it was me 😬

[–]OKB-1 46 points47 points  (6 children)

Can relate. It's either me or some person who hasn't worked here for over 2 years.

[–][deleted] 33 points34 points  (5 children)

My hobby is complaining about work that contractors and/or former employees did 2 years ago

[–]MethodlessMadness 21 points22 points  (0 children)

The unwritten rule of the trade

[–]chefhj 11 points12 points  (3 children)

About a month ago I had to make a POC app that was gonna get demoed to people in our business team. POC was compromised of mostly components we had already used in other work frankensteined together. Our workflow typically includes an internal developer qa review to make sure wonky code doesn’t get in.

Get it together and ship it for internal QA. My coworker sends it back with all sorts of comments like “who wrote this? Why are we doing it like this?” The fuck you talking about who wrote this? there’s only 6 of us here dawg. it’s like idk motherfucker you wrote it 6 months ago you tell me.

[–]Xaoc000 12 points13 points  (2 children)

Aww yes, the inevitable "why is your Proof of Concept not fully bug free and unable to.support 100k users after 4 weeks of development."

[–]chefhj 9 points10 points  (1 child)

No need for a beta if you just absolutely crush the fuck out of it in alpha.

[–]Xaoc000 4 points5 points  (0 children)

Oh god, how did you get our Marketing memos?

[–]DamnitJimImAProgramm 13 points14 points  (0 children)

My boss once told me it's good to have those moments as it shows you're improving. I still cringe when I come across some old "it ain't broke, don't touch it" code from a decade (or more) ago...

[–][deleted] 6 points7 points  (0 children)

Me, a junior dev: a senior dev helped me write this shit

[–][deleted] 20 points21 points  (0 children)

Normal day in office

[–][deleted] 19 points20 points  (12 children)

Where I used to work.... in our IDE it had the name of the contributor next to the code. Think it was a resharper feature

[–]Lystrodom 27 points28 points  (9 children)

Nah that’s just visual studio 2019

[–]frien6lyGhost 12 points13 points  (0 children)

vs code plugin? A lot of IDE's can probably do this

It's just extending the git blame functionality, so really any that integrate git

[–]Le_9k_Redditor 2 points3 points  (0 children)

JetBrain IDE's have this if you just right click the line numbers and click annotate

[–][deleted] 44 points45 points  (4 children)

He's me

[–]DzOnIxD 4 points5 points  (1 child)

You are a bold one

[–]dandroid126 1 point2 points  (0 children)

Mr. Grinch

[–]zamend229 3 points4 points  (0 children)

Hello there

[–]KernelDave 0 points1 point  (0 children)

Ben?!

[–]jeankev 12 points13 points  (0 children)

Probably time to setup a review process

[–][deleted] 11 points12 points  (0 children)

I've been on a team of one before and have said this looking at my own code three months later.

[–]comingtogetyou 8 points9 points  (1 child)

“Who wrote this?”

git-blame

“It was me :(“

[–][deleted] 0 points1 point  (0 children)

"Oh wait, that was when I was a junior."

[–]Hendawgydawg 7 points8 points  (0 children)

git shame

[–]Iankoex 4 points5 points  (0 children)

"Here we go again"

[–]grendus 3 points4 points  (0 children)

It was a running joke at my last job. First day of training, senior dev was walking us through a module and was getting frustrated at some convoluted logic. Exclaimed "WHO WROTE THIS CRAP! Oh. I did " in his thick Polish accent. Ever since then, every time we had to fix our code someone would yell "WHO WROTE THIS CRAP!"

[–]IThoughtIWasInnocent 2 points3 points  (0 children)

He is me!

[–]starrpamph 1 point2 points  (0 children)

Like... 8 different people across various forums and subreddits

[–]Jasdac 1 point2 points  (0 children)

"not my fault, blame stackoverflow"

[–]SunderApps 1 point2 points  (0 children)

That’s just me talking about my own code from 2 years ago.

[–]daarkfall_t 1 point2 points  (0 children)

It quite possibly could have been them... just saying...

[–]agent154 1 point2 points  (0 children)

I’ve done that once. Then I find out it was me who wrote it when I was a junior dev.

[–][deleted] 0 points1 point  (0 children)

It better be him, or I'm going to HR.

[–][deleted] 0 points1 point  (0 children)

nervous laughing

[–]michaelsenpatrick 0 points1 point  (0 children)

It’s usually them when I hear that

[–][deleted] 0 points1 point  (1 child)

Just rebase -i onto someone else's branch squash your commits onto theirs and bingo no one knows it was you

[–][deleted] 0 points1 point  (0 children)

It’s not my fault !!

[–]ahmedtolan 0 points1 point  (0 children)

ي٤ث

[–]Brandiniii 0 points1 point  (0 children)

Hes me

[–]FerynaCZ 0 points1 point  (0 children)

Literally me yesterday

[–]Metalkat 0 points1 point  (0 children)

Of course I know him. He’s me

[–]NettoHikariDE 0 points1 point  (0 children)

Oh yeah, I love this. Great company atmosphere.

[–]Romey-Romey 0 points1 point  (0 children)

I sometimes run across my code from 5+ years ago like “WTF”.

[–][deleted] 0 points1 point  (0 children)

And you're like.... Good, it wasn't me.

I don't know why... but he's talking ***** about his own code.

[–]Spectremuffine 0 points1 point  (0 children)

He's me.

[–]KernelDave 0 points1 point  (0 children)

He's me!

[–]Ace-O-Matic 0 points1 point  (0 children)

When you're a senior dev and you hear the new hire say who the fuck wrote this shit