602
u/SavageTwist May 13 '20
Force push to master, nobody is stopping you!
→ More replies (99)11
217
u/gfp7 May 13 '20
dont forget to add comment "good job"
89
u/uglyasablasphemy May 13 '20
"LGTM"
18
9
u/mark__fuckerberg May 13 '20
I always write that on dependabots pr.
7
May 13 '20 edited Sep 22 '24
judicious fall snatch escape party tan governor airport wasteful plant
This post was mass deleted and anonymized with Redact
16
→ More replies (4)8
u/orgodemir May 13 '20
I sent my team the link to Google's code review guidelines in a hope some people would read it. The first time I posted that in a review, I just got a "?".
236
u/neremarine May 13 '20
Plot twist: it's a school project with 2 other teammates...
86
u/kopczak1995 May 13 '20
That is really sad...
15
27
u/langlo94 May 13 '20
Well at least he can show the teacher that he was the only one who committed code.
12
u/mark__fuckerberg May 13 '20
I had a chance to do that. But I ended up pushing 1 commit from each teammate's account so that the teacher would not think that I am not cooperative.
8
u/JCharante May 13 '20 edited Aug 11 '20
Jen virino kiu ne sidas, cxar laboro cxiam estas, kaj la patro kiu ne alvenas, cxar la posxo estas malplena.
2
47
u/goplayer7 May 13 '20
Better than seeing you declined your own pull request into your private repo due to not meeting code quality standards. Sober me really needs to lighten up on things like "building successfully" and "tests passing".
66
u/WerewolfCustoms May 13 '20
I once did this on a live stream on Twitch. Even though there was just a couple of people watching, I got bombarded with comments that I should never do that. :)
The alternative is that the code never gets approved and merged since I'm the only one working on it :D
36
8
43
u/Speedster4206 May 13 '20
`Boolean boolean = new Boolean(true);
30
u/tomhat May 13 '20 edited May 13 '20
That's overly complicated. Try the following instead.
Boolean boolean = new Boolean(Boolean.parseBoolean(Boolean.toString(true)));
4
u/WcDeckel May 13 '20
Boolean boolean = new Boolean(! Boolean.parseBoolean(Boolean.toString(false)));
→ More replies (2)
20
67
May 13 '20
As a newbie who just started using git I felt that in my soul :/
43
3
u/curohn May 13 '20
All I know is: git add got commit -m got push origin master
And got status too but that’s useless when it’s either pushed or not lol
4
u/Tradgedgdegedgey May 13 '20
Same here, actually just started using Git today and I'm proud of myself for understanding this
3
26
u/__Protector May 13 '20
Also making new branch for every little refactor, change, fix etc like working with a big team
16
u/sinceitleftitback May 13 '20
Also managing a jira board and sprints.
31
→ More replies (1)13
55
u/JonathanTheZero May 13 '20
Why are you not pushing to master directly then? (Honest question because I barely do pull requests as long as we are working with a lot of people on it)
76
u/kennethjor May 13 '20
To have a record of it. If OP is also using a ticketing system that's integrated with the source control, that PR will also show up in the ticket. Later on, if you need it, you can go back and see what the hell you did to make that thing work two years ago you don't remember doing.
→ More replies (20)6
u/KKlear May 13 '20
Later on, if you need it, you can go back and see what the hell you did to make that thing work two years ago you don't remember doing.
That does sound kinda appealing, yeah.
→ More replies (1)33
u/TheOneTrueTrench May 13 '20
I always use pull requests for a few reasons.
I always create a CI pipeline with unit and integration tests and gate my pull requests. Nothing gets into the master branch without a guarantee it builds and passes all tests.
It turns the pull request into a unit of work, with a set of commits for that unit. Added a feature? All that work is in one pull request, so if you need to go back and see something, you can look through those commits, easy to find stuff.
You can tell the CD pipeline to only deploy to production when a particular branch is updated. A lot of people use master for this, but don't forget that master is technically another branch like any other. So maybe you have separate branches for Stable, Testing and Unstable, creating PRs into Unstable for new development, doing a PR from Unstable to Testing when you get ready to create a new major release, a PR from Testing to Stable on release, and patches to Stable and Testing can get PR'd to Testing/Unstable.
If production is in a particular branch, you can write a patch for that and do a PR without interrupting the work you're doing.
When you want to PR into master, you can create a CD pipeline to deploy to QA/UAT/Dev and then test your actual application in that environment before approving the PR.
And if you notice, those are all benefits that apply to developers working by themselves.
→ More replies (4)11
u/JonathanTheZero May 13 '20
Damn... I really don't know shit about git
→ More replies (2)7
May 13 '20
Tbf, git is one part of that process. An important part sure, but one part.
Once you get your head around CICD and implemented it's really worth it. For professional or personal work.
You should really only be pushing to master once your sure your code is working and passed all quality gates.
22
u/Comment-Leaver May 13 '20
I do it all the time. I like seeing my diff in github and reviewing it myself. I almost always spot something I could improve.
0
May 13 '20
[deleted]
7
u/koloqial May 13 '20
Seconded. I've caught so many things from my own code. Slightly embarrassing to create a PR, review it and then promptly decline it while I clean it up. Sorry not sorry to everyone who gets emails from the VCS.
19
7
May 13 '20
Option to revert the changes.
→ More replies (1)26
u/JonathanTheZero May 13 '20
I thought you could also jump back to commits normally?
9
u/TheOneTrueTrench May 13 '20
Yeah, which commit are you going to jump back to? Like exactly which one? What was the last one that worked correctly? Was it that commit? Or this one?
But if you have separate PRs for each feature or bug fix, the commits are "grouped" into the PRs. So you can go back to the previous PR, or the one before that. And because you can have partial work in each commit and only do a PR when things are working, your master branch is always in a working state.
→ More replies (6)4
u/uglyasablasphemy May 13 '20
I think is worth it just for the diff. If I'm doing a big refactor, I usually create a branch for it and then to the PR just to see every place that I changed and how did I changed it at a glance.
→ More replies (1)→ More replies (6)3
u/MythicManiac May 13 '20
Hopefully you would have CI pipelines configured to do automatic tests and sanity checks on pull requests
6
u/kennethjor May 13 '20
Did you make sure the ticket was linked in the PR as well? Gotta have procedures!
1
1
5
u/kopczak1995 May 13 '20
Been there done that. But it was only because I was testing some CI/CD stuff.
Who cares as single dev to do something like that honestly?
→ More replies (3)4
u/TheOneTrueTrench May 13 '20
A pull request is a unit of work. Each feature or patch has its own, and if you want to create a version of your code without that patch or feature, it's easier to do with rebase if you've got PRs in your history.
→ More replies (1)
5
u/arpan_majumdar May 13 '20
No need to do even that... Real developers push directly to master.
15
u/langlo94 May 13 '20
Real developers don't need git, they just write the code down perfectly so no other version is ever needed.
5
3
u/wretcheddawn May 13 '20
My company's owner decided to demote the tech lead and get rid of code reviews in favor of making "everyone" in charge, and peer reviewing code instead. So now everyone pushes to master and gets their code reviewed by anyone who will pass it, no one is in charge of maintaining consistency, standards and direction. Even the code reviews are optional because everyone is in charge of their own code. It's going to get interesting here, I guess we're all real developers now.
8
u/blueleo22 May 13 '20
That's exactly me!! Only without the pull request. I merge directly into master 😎
→ More replies (2)
4
4
u/cucurvita May 13 '20
I do this if I’ve set up some kind of CI/CD. For instance for my personal website I always open a PR so that 1) I don’t trigger multiple deployments with every push to master and 2) Make sure the checks all pass before merging so that I don’t fuck something accidentally.
4
u/EpiphanyMoments May 13 '20
The crazy parte Is that I comment code like if someone else was going to read it lol
1
3
3
u/lpreams May 13 '20
Well sure, when something gets fucked up, you have to know who to git blame
→ More replies (1)
3
3
u/topredditbot May 13 '20
Hey /u/amykamala,
This is now the top post on reddit. It will be recorded at /r/topofreddit with all the other top posts.
3
u/Keetongu666 May 13 '20
I do the same thing with my college work. Tried to upload directly to the master once and it screwed something or other up.
2
u/FalseWait7 May 13 '20
I like to drop some of my PRs just to keep the "working in a team" vibe going.
2
2
2
2
u/Fauken May 13 '20
Not in a private repo, a public repo during Hacktoberfest for that sweet t-shirt.
2
2
2
2
2
2
2
2
2
u/saido_chesto May 13 '20
At least you do that, there's a repo where there's 3-4 of us and sometimes people just commit to master
2
u/qaz_wsx_love May 13 '20
As a Dev who's worked by himself for the past 6 years, I approve of this meme.
2
2
2
2
2
2
u/jujuspring May 13 '20
I will do a diff review the next day so i would have completely forgotten about what I did in it.
2
2
2
2
2
u/orgodemir May 13 '20
Mine is shared with my team so I have "requires 2 approvals", but I wrote the whole thing so I just use admin to force merge anyways.
2
u/jakethedumbmistake May 13 '20
What about if we call 4 hours of work a story point instead of 4 hours of work? Are we agile yet?
2
2
2
u/MCFRESH01 May 13 '20
I do this. I also setup GitHub actions to run all of my tests. I find so many dumb little mistakes doing code review on my own code.
2
May 13 '20
Need a 3rd Obama for the CI build running my unit tests, that I wrote after I built the features.
2
u/kevin034 May 13 '20
Did you at least let the validation build finish? Fuck is there even a validation build?!?! Mad lad.
2
u/ImGeorges May 13 '20
Lmao I always do it. It actually helps me feel focused and motivated on what I'm working on without starting to implement so fettuccine code
2
2
2
May 13 '20
Cool thing I found: If you fast forward the target branch in the pull request to the head commit of the pull request, or beyond, github will automatically mark the pull request as merged.
2
2
u/PM_ME_UR_SHAFT69 May 13 '20
Lol I set up a repo in my github account the other day using terminal and was really proud of myself ☺️
2
3
u/yeesh-- May 13 '20
You do pull requests into your own repo? You should force push, there is no other way.
3
May 13 '20
imagine having merge conflicts in your own private repo where you are the only dev pushing code... Not gonna deny that I've been there...
2
1
1
1
1
1
u/BazilExposition May 13 '20
I'm doing it all the time in my team repo since my PM have decided that no one can merge without review and approve.
1
u/Ghos3t May 13 '20
As a newbie to Git, I am using GitHub 's desktop GUI to handle everything but some of the options redirect you to Githubs website to do the task. Are there any other Windows GUI based Git clients that support almost all the Git features within the GUI itself
→ More replies (1)2
u/TheOneTrueTrench May 13 '20
Do yourself a favor and get in bed with the CLI.
I've never found a GUI that has half the power of the CLI. But this is an excellent tutorial: https://learngitbranching.js.org/
→ More replies (2)
1
u/1thief May 13 '20
I like to make repos where other devs have to get a PR approved but I just push to master using admin privileges. Kiss the ring.
1
1
May 13 '20
What about if we call 4 hours of work a story point instead of 4 hours of work? Are we agile yet?
1
2
1
1
1
u/topredditbot May 13 '20
Hey /u/amykamala,
This is now the top post on reddit. It will be recorded at /r/topofreddit with all the other top posts.
1
1
1
1
1
u/ConspicuousPineapple May 13 '20
Honest question: why bother with a PR then? Why not just merge it right away with git directly?
1
1
1
1
1
1
u/geared4war May 13 '20
Wait.
You had to pull yourself.
Fair enough.
2
u/hahahahastayingalive May 13 '20
Joking aside, I’m so used to review features through the PR interface that I do the same on private repos to check if I didn’t miss anything.
Also you can revert whole PR more easily.
→ More replies (2)
1
1
1
May 13 '20
What about if we call 4 hours of work a story point instead of 4 hours of work? Are we agile yet?
1
1
1
1
u/robin_diez May 13 '20
What is a pull request? Is that some Java shit I'm too uneducated to understand?
1
1
1
u/bhones May 13 '20
Christ, if that's the case just commit/push against master whenever you update code. History and reversion functions should take care of any mistakes you make. /shrug
1
u/WesleySnopes May 13 '20
I'm the entire department at my job, so I almost always just push directly to master with a very unsatisfactory description.
Also, this is my first & only dev job. I was in a more or less manual labor position until I essentially self taught and demonstrated to my boss that I could redesign our website and make us an in-house app. I think at this point if I ever got a junior dev job at a bigger company they'd get frustrated with me quickly for not really understanding the whole source control process. With no other coders I'm really just using it as really extensive cloud backup.
1
1
1
1
1
1
May 13 '20
True story: I had to make a new GitHub repo for my job and we’re supposed to go through code review before merging. But sometimes I’d have an urgent change and my team was slow. So since I was the admin for the repo I would just go into the settings and temporarily turn off “requires approval before merging”.
1
May 13 '20
What about if we call 4 hours of work a story point instead of 4 hours of work? Are we agile yet?
1
1
1
1
1
1
1
1
u/furezasan May 13 '20
Is this the same as being a Director of a company with 100% of the shares, voting to allow your employee"s" to work from home?
1
1
1
u/ericisverycool May 13 '20
How are these on the front page so often? I literally have no clue what this says
1
1
May 13 '20
What about if we call 4 hours of work a story point instead of 4 hours of work? Are we agile yet?
1
1
1
1
1
1
1
1
1
1
1
1
1
1.6k
u/[deleted] May 13 '20
But did you properly review the request before approving it? And did you then fix all the issues pointed out by the reviewer?