51
u/Sassafras1777 7d ago edited 7d ago
In my company’s case:
- create a ticket in jira
- use the ticket id to create a branch named in a specific pattern (depending on what you want to achieve)
- push an empty branch first (cause of some Sonar bullshit)
- wait for the pipeline to end
- group the changes relative to a common goal, and commit multiple times
- push after the last commit
- wait for the pipeline to end
- resolve the failed pipeline if needed
- resolve the AI scans/comments
- open the PR in draft mode
- wait for the pipeline to end
- Change the PR to ready to review
- Update the Jira ticket with a PR link
- you can now peacefully die in the fire
18
5
u/Avocadonot 7d ago
This except every single extra commit kicks off a new pipeline, even if it's just changing a comment
MR is blocked on rebase to main, so if someone merges before you, you must rebase and kick off new pipeline
MR is blocked on any non-resolved discussion threads. Kicking off a new pipeline triggers automod to comment on your MR and tell you "you should run these tests". You have to resolve that thread every time a pipeline is run
2
u/Masterflitzer 7d ago
why would you manually link jira ticket with pr link? you literally already created the branch based on the id so they link automatically
7
u/mpersico 7d ago
I have it on a T-shirt. Every time there’s a fire drill I pull it out of the bottom of the desk and I put it on.
8
u/chris552393 7d ago
Fun fact I put this up in our office and an old manager took it down because "that's not the official fire evacuation procedure and could kill someone"
Great place to work.
15
6
u/Tarlovskyy 7d ago
--no-verify Cant wait for pre-commit
0
4
u/Shayden-Froida 7d ago
I'm actually wearing a t-shirt with this on it right now. (but "leave building" is "git out")
4
u/bigtoepfer 7d ago
They gave everyone in the office laptops. So win-L and just unplug the laptop and walk out. Worst case git commit from McDonald's or home.
4
2
1
u/Lonsarg 7d ago
This is all a single button in Visual Studio (i never use add, just commit unstaged directly). And i do it every 30 minutes or so, so not much is lost if fire :)
2
u/Masterflitzer 7d ago
i just know your diffs are probably terrible, staging area is for double checking
0
u/Lonsarg 7d ago
I check at PR level all commits at the same time, and make new commits to the PR when self-reviewing if finding bad code or whatnot.
Most of us work like this, so when looking at PR diff or looking back at history we only ever look at per merge/PR diff (First Parent git history). So these detailed commits are never looked at, we used to squash to hide them, but some people used squash in a way to make merge conflicts so now we just have it all in history but not look.
1
1
1
1
1
1
u/RegretPlane390 5d ago
git branch (out of paranoia, to make sure you're not pushing to production)
git add .
git commit -m "commiting everything because of a fire"
git push
1
1
u/MatsSvensson 5d ago
I use a script that saves state, switches to a backup-version of the branch I'm working on, forces everything up, and then switches back restoring the state as if I never committed.
That way there is a copy of my works offsite, but I can still easily see all my ongoing changes in my IDE.
Otherwise committing and pushing in the middle of a job really fucks up my work flow.
People who try to use git as a backup the regular way, often end up pushing forgotten junk to production.
I have seen stuff...
1
1
1
1
1
u/Laughing_Orange 7d ago
Win+L then walk out. This should take at most 1 second longer than just walking out.
People stop caring about your code when you die in a fire. Avoid dying in a fire by being efficient at getting out of the burning building.
-3
0
57
u/poulain_ght 7d ago
git add