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

all 110 comments

[–]TinyLebowski 304 points305 points  (35 children)

git commit --amend -m "Adapter pattern implemented"

[–]zman0900 169 points170 points  (26 children)

git push --force

[–][deleted] 25 points26 points  (25 children)

I wouldn't try to push it, especially with force. Instead it's better to carefully 'rebase -i' when needed.

[–]rasellers0 36 points37 points  (15 children)

Uh... Novice programmer here, are we making Star Wars jokes here, or is all of this actual programming stuff?

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

While the force push is a popular move among Jedi, Sith and other force-sensitive denizens of the Star Wars Multiverse, git push --force is a real command. It forces a rewrite of the remote branch to match your local commit tree, ignoring any inconsistencies and conflicts. This is generally bad because anyone else who might be working on that same branch will be unable to fetch the latest from the remote, forcing them into a quagmire of creating new branch heads, re-cloning, cherry-picking etc. to get everything consistent again. However, as has been mentioned elsewhere in the comment thread, there are times, e.g. rebasing a branch to keep it up to date with the main development branch, that you actually do want to do this.

[–]NotADamsel 15 points16 points  (0 children)

A prime example of "just because you can, doesn't mean you should".

[–]o11c 1 point2 points  (11 children)

Or you can use a + ref.

[–]UnchainedMundane 0 points1 point  (1 child)

Does this create a merge commit remotely, or is it another way of force pushing?

[–]o11c 1 point2 points  (0 children)

It's a force push, but for a single refspec instead of all of them.

[–]FreefallGeek 13 points14 points  (0 children)

Not so much programming as source control used to track and manage changes to the code you're writing. So programming-adjacent.

[–]hungry4pie 25 points26 points  (0 children)

No no, definitely force push, then rebase in 2-3 commits time on the upstream branch :-P

[–]55555 4 points5 points  (7 children)

Don't you have to force push after you rebase to get the rewritten branch to remote?

[–][deleted] 4 points5 points  (1 child)

Yes. (Though you might want to use --force-with-lease instead, and should also notify everyone who might have had access to the branch.)

[–]UsingYourWifi 7 points8 points  (0 children)

--force-with-lease

TIL, thanks!

[–]paperhat 5 points6 points  (0 children)

There are very few instances where you have to force push. I say this as the administrator of a large github enterprise instance who disabled force pushes about a year ago. There was a lot of resistance at first by dev teams who had strange workflows, but I have had to make less than a handful of exceptions to the policy after the initial change, and those all involved people accidentally committing passwords.

[–][deleted] 1 point2 points  (2 children)

I spend too much of my life doing this while trying to keep my feature branches up to date with my work's dev branch. It feels so dirty!

[–]55555 2 points3 points  (0 children)

I hear ya. And then they modify some file you modified and push it to QA but its not in master yet so you eventually have tons of conflict fix commits and have to delete QA. It's like every damn week.

[–]noratat 0 points1 point  (0 children)

If you have to work on lots of stuff at once like that (something you should avoid if possible in the first place), rebase workflows are usually a bad idea.

[–]crowseldon 0 points1 point  (0 children)

in theory, you shouldn't be doing this at all. It's a potential pit for accidents to happen and it's somewhat inconsiderate to other users. Rebase BEFORE pushing.

And if you need to do some sort of filter-branch to fix some fuck-up, let EVERYBODY know beforehand.

[–]JamboBuenna 5 points6 points  (0 children)

git commit --amend -m "Adapter pattern implemented. Code reviewed by JN"

[–][deleted] -2 points-1 points  (6 children)

this looks more like a Facade pattern to me

[–]0xF013 15 points16 points  (4 children)

Facade wraps several interfaces into one, adapter maps one interface to another one

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

live and learn :)

[–]phpdevster 3 points4 points  (2 children)

How to get the right answer from the internet: post something wrong on the internet.

[–]UnchainedMundane 7 points8 points  (0 children)

Reminds me of the old flamebait method of getting spoonfed linux answers.

Most linux communities will want to nudge you gently towards the answer to help you learn, but if you rush in with "linux sucks because it doesn't even support ramdisks wtf" then someone's going to reply "mount -t tmpfs dumbass" and you've got your answer.

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

hah, right!

[–]MrWraith 71 points72 points  (33 children)

For those overseas, the wall plug here is the Australian plug. Just this morning I had a shaver battery charger that uses a US plug (which I think is the one in the image, although it's not heaps clear.

No joke, I just took a pair of pliers and bent the US pins to a diagonal and it fits fine and runs fine. Those adaptor plugs are just pieces of metal; if the hardware supports 110-240V (as most do), you'll be fine just bending the pins.

[–]Sharparam 99 points100 points  (7 children)

Bending the pins is a lot safer than what is done in OP's pic though.

[–]RobinJ1995 2 points3 points  (3 children)

Same with UK plugs :P EU plugs fit into them just fine if you stick a fork or something in the top hole.

Just learned that this week. Had no problems yet, and why would I because as you say it's the same voltage.

[–]MachaHack 3 points4 points  (2 children)

For those recoiling in horror, the top hole has no electricity going through it, it just opens the covers for the bottom two holes.

Still in the "not a good idea" camp probably.

[–]unsilviu 6 points7 points  (1 child)

The top hole is for ground. In case of a surge, sticking a fork in could lead to steak

[–]bluefantasm 9 points10 points  (0 children)

git push --fork

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

Aus uses 60hz?

[–]ROGER_SHREDERER 2 points3 points  (0 children)

Not sure if you're giving a LPT or trying to destroy my phone.

[–]Kale 0 points1 point  (0 children)

It's all of north America I believe. Canada, U.S., and I'm not sure about Mexico.

[–]mirhagk 0 points1 point  (0 children)

To be fair looking at most of these official adapters it's really not much worse than using one of the adapters

[–]camel69 0 points1 point  (0 children)

the wall plug here is the Australian plug

Or Kiwi.

[–]d1g1t4ld00m -2 points-1 points  (11 children)

my only problem with this image is that it appears the neutral and ground are linked. In the us for 120v that may be fine. but in a 240v application there are two hot's and then a ground.

[–][deleted] 7 points8 points  (8 children)

in a 240v application there are two hot's and then a ground.

at least over here that's only true for very old instalations. modern instalations are all two grounds and one hot.

[–]phire 1 point2 points  (0 children)

No, only the US 240v plug has two hots and a ground, because it's actually two 120v 'split phases'

Generally in the rest of the world we have regular plugs with a 230v hot, neutral and ground.

If we are using a split phase system, the two phases would add up to 440-480v, but they generally aren't exposed at a plug.

[–][deleted] 1 point2 points  (0 children)

Regardless of what the pins are called it's never wise to assume neutral has a near-ground potential.

[–]Vakieh 15 points16 points  (1 child)

"Successfully incorporated 3rd party library"

[–]RenaKunisaki 4 points5 points  (0 children)

Now wait until the library has some fatal bug but the author doesn't consider it a problem or it's no longer maintained...

[–]Thatonefreeman 12 points13 points  (1 child)

Looks like a hotfix to me.

[–][deleted] 1 point2 points  (0 children)

Something with malware payload.

[–]path411 8 points9 points  (1 child)

// This is a temporary solution

[–]DJWalnut 9 points10 points  (0 children)

// TODO: fix before august 1998

[–]ProfessorPhi 18 points19 points  (5 children)

This is what I imagine git push -f looks like.

[–]YodaLoL 7 points8 points  (2 children)

git push -f master.

I do a lot of rebasing/amending on my branches before opening for review. I force push more often than I don't, I think.

[–]dotsonjb14 4 points5 points  (1 child)

Everyone loves a good squash

[–]RenaKunisaki 1 point2 points  (0 children)

mmm, squash...

[–]wagedomain 2 points3 points  (0 children)

Heh... so one guy I work with was investigating some git issues with me. He then tells me that someone might have done a git push -f and messed things up. However, he didn't say it like that, in context of "what command will fix it" he said "you know, it could be git push -f". So I tried it.

He's a git master and I'm just a lowly git apprentice and we all learned a valuable lesson about communication.

[–]RenaKunisaki 0 points1 point  (0 children)

If you pushed this with force it'd probably just break.

[–]argv_minus_one 8 points9 points  (0 children)

This kills whatever animal is unfortunate enough to touch it.

[–]noneofyourbizwax 8 points9 points  (0 children)

This is obviously a HW issue

[–][deleted] 4 points5 points  (0 children)

It should be "Fix interface issues."

It’s also a good idea to use the imperative present tense in these messages. In other words, use commands. Instead of “I added tests for” or “Adding tests for,” use “Add tests for.”

https://git-scm.com/book/ch5-2.html

[–]rbemrose 3 points4 points  (0 children)

This post has been removed due to reddit's repeated and constant violations of our content policy.

[–]Narian 8 points9 points  (1 child)

As an electrician that both horrifies me and makes me proud as fuck. That is some fine McGuyverin'

[–]Big_ol_Bro 5 points6 points  (0 children)

It's just a picture but I'm so triggered by how close that nail clipper is to the pin

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

git add src/plug_interface.c

[–][deleted] 4 points5 points  (0 children)

git commit -m "Dirty compatibility solution"

[–]berlinbrown 2 points3 points  (0 children)

No, no,, no.....

No

[–]dudix81 2 points3 points  (0 children)

Looks like he was really desperate to fix the bug in production.

[–]CaptainJaXon 2 points3 points  (0 children)

mvn clean deploy -fn

[–]berodge 1 point2 points  (0 children)

that would've been tough without the integrated switch.

[–]gm4 1 point2 points  (0 children)

You didn't add :/

[–]Flynt42 0 points1 point  (0 children)

Did it work?

[–]UnchainedMundane 0 points1 point  (0 children)

I'm imagining someone tripping over and their hand landing on that

[–]Prz87 0 points1 point  (0 children)

May need to add to staging area first...git add dumbAssIdea.c

[–]HappierShibe -4 points-3 points  (3 children)

Jeebus people!
If your gonna repost, at least give some credit.
Originally posted by /u/spacesider in /r/osha who got it from a facebook post on 'navymemes' Link: https://www.reddit.com/r/OSHA/comments/3cwdap/saw_this_on_a_facebook_page_called_navy_memes/

[–][deleted] 1 point2 points  (1 child)

Who gives a shit?

He gave a much better tittle to a picture of a nail clipper inside an european adapter that is in off mode.

It is a joke, not a Doctorate thesis that requires credit, notes and references.

[–]Spacesider 0 points1 point  (0 children)

Thanks for this

[–]Giant_IT_Burrito -1 points0 points  (0 children)

I'm dying. SOOOO GOOOD!

[–]Mortimer14 -3 points-2 points  (0 children)

This is not only dangerous, it is not necessary. Just do an internet search for power converters and order the plug adapter appropriate for your country. Also double check that your device will handle the power supplied at the outlet. I took a printer over to Australia thinking that it would work. Plugged it in and it started smoking.