Live data from Hacker News

Git git git git git

caiustheory.com

191–200 of 244 posts

Re: Git git git git git

#191
post #35

Earlier quoted context omitted.

I often type "git clone ", then switch to a browser to copy/paste the URL, which is usually fine, but there are still many times where I've happened to include "git clone" in the copied string. (So I end up with "git clone git clone $URL").

I think that advice got warped/lost in translation: Wasn't the original advice "dont't paste stuff copied from web pages into the CLI"? - Because a bad page could covertly change what is actually copied via JS.

That danger doesn't apply when things are copied from the browser chrome (address bar) or other locations. So why would pasting then still be dangerous?

I think blindly passing on advices "because $SECURITY" can actually detrimental to security because you may end up with half a dozen esoteric practices without actually knowing what they defend against. (I know the parent was half-joking, I think that's a more general problem)

Re: Git git git git git

#192

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.

CTRL-u CTRL-v

Nice! Never knew about CTRL+u. Thanks.

Re: Git git git git git

#193
post #153
post #149

Earlier quoted context omitted.

I just alias 'pull' to git pull, it's much nicer. Also 'push' and a few of the other most common ones.

Or alias to gp, gl, gd, ga, gmv, grm, gsh, glg, gcm, gcam, gpuo, gdwd, gpuom, ...

You're joking but...

    alias g='git status -sb'
    alias ga='git add'
    alias gac='git commit --amend'
    alias gb='git branch'
    alias gbb='git checkout -b'
    alias gbm='git branch --merged'
    alias gbn='git branch --no-merged'
    alias gc='git commit -m'
    alias gcp='git cherry-pick'
    alias gco='git checkout'
    alias gd='git diff'
    alias gdc='git diff --cached'
    alias gg='git status'
    alias gl='git log --graph --pretty=format:"%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)%Creset" --abbrev-commit'
    alias gla='git log --all --graph --pretty=format:"%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)%Creset" --abbrev-commit'
    alias ggpublish='git push && git push --tags && npm publish'
    alias gp='git pull --rebase && git push'
    alias gpp='git push && git push --tags'
    alias gpl='git pull --rebase --prune'
    alias gpt='git pull --rebase && git push --tags'
    alias grb='git rebase'
    alias grc='git rebase --continue'
    alias gsp='git stash ; gp ; git stash pop'
    alias unfuckgitremote='git branch --set-upstream-to=origin/`git rev-parse --abbrev-ref HEAD` `git rev-parse --abbrev-ref HEAD`'
I have to admit I use `unfuckgitremote` more often than you'd hope.

Re: Git git git git git

#194
post #101

Earlier quoted context omitted.

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.)

> safe operations are a subset of idempotent operations Definitely not. 'Safe' means too many things in different contexts to make sweeping statements like that. Here's one i came across recently. You are interacting with a stock exchange. You have sent an order to buy 100 shares of Twitter stock at some price, and it is now resting on the order book, waiting for orders to sell at that price. You see that the charact…

I agree with you generally that talking about 'safe' may be misleading. However, I don't think your example shows that idempotent operations can be 'unsafe' - I think it shows that the translation of user's intent to a system operation was lossy. The user's intent was to "buy a total of 90". Translating that to "Set my current order to 90", regardless of the idempotency of the operation, is not accurate, for precisely the reasons you stated. Neither is "reduce my order by 10", because the user may attempt to send the message "set my current order to 90/reduce my order by 10" multiple times(just to make sure it went through), and then they would get to buy less than 90 shares.

It would take different data structures and a different API to translate the user's intent correctly, and then the idempotence of the operation may be important. For example, if the order had a "total" and "current balance", you could be sending a message to set the total to 90(which would internally reduce the current balance), and since that message is idempotent, it's safe to send it multiple times.

Re: Git git git git git

#196
post #63

Earlier quoted context omitted.

Not this, but I do fairly often think assume I'm in vim when I'm not. `alias :q="echo NOT IN VIM!!!"`

I actually aliased :q to clear: https://github.com/jez/dotfiles/blob/master/util/aliases.sh#... I also have clera, lcear, and lcera -> clear, and :tabe -> vim.

Are you aware Ctrl-l also clears? I can't recall the last time I typed clear.

Re: Git git git git git

#197
post #7

I want a terminal that highlights things it thinks are off. Like when I type cd cd or git git. But I don't want it to auto fix nor wait until the command is issued to complain. This is because I want to be the sole controller of what command is actually issued. Call me an old curmudgeon but I just don't trust the auto fix solutions. Edit: had no idea about Fish. Thank you, all.

Fish shell like syntax highlighting for zsh: https://github.com/zsh-users/zsh-syntax-highlighting Fish-like autosuggestions for zsh: https://github.com/zsh-users/zsh-autosuggestions

Or if you don´t care for fiddling about too much and just want it to work out of the box: http://ohmyz.sh/

Re: Git git git git git

#198

>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 sometimes do, though not specifically with git. Can be emacs, can be ls, can be anything where I interrupt my thought process.

So... I really fail to see why this article is of any relevance at all, really. Or at least a more global solution would have been better, but I think it's not really an annoyance. For me, it's the same as wanting to fix a UI so that I wouldn't re-double-click a software that I've already started (well, some prevent it, and generally when they do, it means there are sessions, and it annoys me).

Re: Git git git git git

#199

Why type out `git status`? I use `gst`, and lots of other great aliases provided by the [oh-my-zsh git plugin]( https://github.com/robbyrussell/oh-my-zsh/blob/master/plugin... )

I have alias wow='git status' in my .profile because it's more fun (to me).
Post reply on HN