
Don't commit when you're drunk - onatm
https://github.com/noidontdig/gitdown
======
watt
This is wrong, this goes against DVCS philosophy.

You should be able to commit all you want all night long, but should not be
able to _push_.

~~~
cema
Precisely! And that's why we have two (logical) levels of commit.

------
csmuk
I've written and committed my best bugs when drunk. Undoing them was a
valuable learning exercie. The finest being, in C:

    
    
       if (nr = 0x56) ...
    

That took and entire day to find and made me religiously avoid lvalue
assigments in expressions by doing:

    
    
       if (0x56 == nr) ...

~~~
InclinedPlane
That should generate a compiler warning. And if you're not a criminal you have
warnings set as errors.

~~~
weland
There is nothing incorrect or dubious in C about an expression like if (foo =
bar), so it wasn't considered a reason to warn the user about for a long time,
despite being a rather common culprit for bugs. Compilers popping up warnings
about that is a fairly recent event.

~~~
goldenkey
Pretty sure that's been a warning for a long long time in most compilers. They
require you to wrap the assignment to suppress it, that is: if ( (foo=bar) )

Anyho, it really depends on what your -W level is set to. It's good practice
to use "-Wall"

~~~
tubs
-Wall doesn't give all errors though, you probably want -Wall -Wextra.

~~~
trentmb
What a misleading name for a compiler flag.

~~~
csmuk
Yes this is why people worship LLVM...

------
NicoJuicy
Slightly drunk is fine, for me it helps for not overengineering things and i
just write code that works.

When completely sober, i think to much and i overengineer (overthink) stuff...
Programming is just slower...

(Think DDD-like programming)

1 beer is enough to get very concentrated... Just don't overdue it (and don't
make a habbit of it).

I only do it when i need to get things done, when time is limited... Never had
serious bugs (Windows ME like) though :-P

It happens once in the 2 months and mostly it's for 2-3 days in the weekend
(non-stop), with some light kind of music (Enya or concentration like mp3's)
and headphones.

Yeah, i'm a nerd then :P

------
minimax
Why is this stupid frat house bullshit on the front page of Hacker News? We
can do better than this.

~~~
mathattack
It boggles my mind that this needs to be said, even if in jest. Just looking
at the subject, I think, "What kind of idiot needs to be told not to commit
when drunk? Do they need to be told not to drive when drunk too?" And the
article is worse than the subject.

~~~
Crito
Have you considered the possibility that you have encountered something called
a "joke"?

They can be a little tricky, but I'm sure you'll get the hang of them if you
try.

~~~
mathattack
Especially tricky before my first cup of coffee in the morning. Just ask my
wife! :-)

------
scoot
Obligatory xkcd ("Ballmer Peak"): [http://xkcd.com/323/](http://xkcd.com/323/)

~~~
Svip
Don't worry, it is already a supported mode, which only lets you commit
between 0.13% and 0.15% BAC.

------
benjamincburns
Yes, I realize (hope) this is a joke, but this is the most "programmer"
response to a drinking problem I've ever seen.

    
    
        I know, I'll externalize and automate my impulse control!

------
msantos

        > Don't commit when you're drunk 

That's a valid premise for whatever you do in life, not only Git.

------
Crito
It might be neat to replace the arduino/breathalyzer part with some sort of
typos/minute metric, collected from the number of miss-typed commands you have
had recently.

Trying to run `git psuh` too many times in an hour could get you a cooldown
period so you can either sober up or wake up.

------
lmm
It should be fine to commit when drunk, that's what VCS is for. Make it tag
the last sober commit and disable "git push -f" instead.

~~~
mooism2
And it goes beyond being drunk: sometimes I code when I'm tired but can't
sleep. I have a vcs to ensure I don't trash something irretrievably; also
tests and ideally a decent type system to increase the chances my code does
what it should.

------
timclark
Also, don't edit your bash profile when drunk! In my youth I did this and it
took 3 weeks to return to normality - I didn't know about source code control
in those days.

------
josefresco
What about a check for _prescription_ pain killers or amphetamines? Oh wait,
those are culturally acceptable mind altering things. I'm half joking but this
is a neat hack, although I know many functioning alcoholics that would laugh
at the concept of this.

------
np422
One of my old colleagues had the bright idea to log onto one of our production
systems to "re-index some of the database tables" after coming home one Easter
eve.

And yes, he wasn't directly sober at the time.

I was moderately amused when I got woken up about 3 AM and got to spend a few
hours trying to revert the "re-indexing" ...

I think integration with ssh-key management to prevent people logging onto
production systems when drunk would be a good idea for this project, don't be
surprised if there is a pull request from me in the future ...

------
T-zex
If you do, you better call Saul.

------
psutor
I'd think the best use of this interface would be to only allow you to commit
while in the Ballmer Peak.

------
goldenkey
Gotta love the names..Krunk mode and Balmer mode. Who woulda thunk of that..oh
no one except a drunkard. :-)

------
professorTuring
Kids and drunks always commit the truth.

------
nickthemagicman
I didn't even read this. Is it as dumb as I immediately assumed?

------
belorn
Is committing tired more dangerous than committing tipsy?

------
dep_b
Don't get into any commitment when you are drunk.

Period.

------
exit
definitely shouldn't commit with a decreased libido

------
motyar
Should be used in cars.

~~~
rplnt
I've read about it being in some car(s) maybe a decade ago. Haven't heard
about it since. Probably not something users want.

~~~
Cthulhu_
I'm pretty sure it's common to install a breathalyzer in cars nowadays if
you've been caught with driving under the influence (probably repeatedly or
over a certain percentage) in various countries / states.

