Live data from Hacker News

Git git git git git

caiustheory.com

91–100 of 244 posts

Re: Git git git git git

#91
Quite often, I accidentally press the space bar eagerly when typing git commands:

    $ gi tstatus
To fix this, I've added the following to my .bashrc:

    gi() {
        args=("$@")
        args[0]=${args[0]/t/}
        git "${args[@]}"
    }
It also works if you drop the "t" altogether.

Re: Git git git git git

#92

Earlier quoted context omitted.

I always typed rebnoot, so I patched Netbsd to allow rebnoot. Then I patched it still so it would say, "Rebnooting". Fun times.

Can't tell if serious...

Knowing software developers, probably entirely serious.

Re: Git git git git git

#93
post #82

Earlier quoted context omitted.

In the context of software it seems like the word has pretty broadly adopted the meaning of "side-effect free". It's even made it to Wikipedia: https://en.wikipedia.org/wiki/Idempotence#Computer_science_m... One notable example: Stripe's "idempotency keys": https://stripe.com/blog/idempotency

I understand 'idempotent' not as 'having no side effects' but as 'having the same side effects whether performed one or many times'. This is side-effect free: echo hello This is side-effectful, but idempotent: echo hello >world This is side-effectful and not idempotent: echo hello >>world

I disagree that your ‘ echo hello’ example is free of side effects. It writes to stdout. It overwrites $?. It changes the value of the last executed history command. Etc.

About the only side effect free operation at a blank line terminal prompt is _probably_ hitting enter or ctrl c. Or ‘#something’

But your idempotency examples are spot on.

Basically, idempotency is a very useful concept. Side effect free isn’t.

Re: Git git git git git

#94

Earlier quoted context omitted.

I had a senior dev interview with a major company in SV last year where the lead and hiring manager claimed that the description for this behavior was "side-effect free". I didn't want to ruin my chances by correcting him that side-effects and idempotence refer to different qualities. I passed the interview, but I've never forgotten that. The guy also seemed to have washed into the interview off his surf board. Oh we…

In the context of software it seems like the word has pretty broadly adopted the meaning of "side-effect free". It's even made it to Wikipedia: https://en.wikipedia.org/wiki/Idempotence#Computer_science_m... One notable example: Stripe's "idempotency keys": https://stripe.com/blog/idempotency

It’s funny because if you read what they wrote, they’re fully aware of the difference between the two (since they reference the HTTP RFC definition of the idempotency of PUT and DELETE).

Re: Git git git git git

#95
post #85
post #82

Earlier quoted context omitted.

I understand 'idempotent' not as 'having no side effects' but as 'having the same side effects whether performed one or many times'. This is side-effect free: echo hello This is side-effectful, but idempotent: echo hello >world This is side-effectful and not idempotent: echo hello >>world

Interestingly, in this case the non-idempotent option is less safe.

Non-idempotent options are always unsafe; safe operations are a subset of idempotent operations.

(I suspect you meant “safe” in a different sense, but I couldn't resist.)

Re: Git git git git git

#97

>I quite often type git then go away and come back, then type a full git status after it. Does anyone else actually do this besides OP. I've never heard of this problem until now.

I do. And I also write "vim vim thefile.txt" and stuff like that. Finally I've written a small shell function that corrects "gi tpull" to "git pull", because that happens at least once a day.

Try The Fuck: https://github.com/nvbn/thefuck/blob/master/README.md

Re: Git git git git git

#98
post #69

Earlier quoted context omitted.

The one I do is `git clone ` then paste in the repository URL from bitbucket, and end up with `git clone git clone https://....` I don't think that can be solved here though.

Hah! Bitbucket drives me nuts in many ways but this one truly is the worst!

Certainly. The user is either used to typing "git clone" or is using a GUI where you input the repo URL. How bitbucket does it would only be fine if you only use bitbucket or if everybody did it that way.

Re: Git git git git git

#99
post #82

Earlier quoted context omitted.

I understand 'idempotent' not as 'having no side effects' but as 'having the same side effects whether performed one or many times'. This is side-effect free: echo hello This is side-effectful, but idempotent: echo hello >world This is side-effectful and not idempotent: echo hello >>world

I disagree that your ‘ echo hello’ example is free of side effects. It writes to stdout. It overwrites $?. It changes the value of the last executed history command. Etc. About the only side effect free operation at a blank line terminal prompt is _probably_ hitting enter or ctrl c. Or ‘#something ’ But your idempotency examples are spot on. Basically, idempotency is a very useful concept. Side effect free isn’t.

> I disagree that your ‘ echo hello’ example is free of side effects.

I posit that you understand perfectly well what i was getting at! If it helps, imagine that you are spawning a fresh shell to execute each command line, through system(3) or some such.

Post reply on HN