News for hackers. Stuff that matters.
Re:Ask HN: Google/FB engineers, Do you like Mercurial? by lifebeyondfife on Thursday May 07, 2015 @09:17AM (#9504785)
> hint, if you ever type "pull" you are doing it wrong

Genuine question: what's wrong with executing 'git pull' on a branch you haven't changed locally?

Re:Ask HN: Google/FB engineers, Do you like Mercurial? by leni536 on Thursday May 07, 2015 @09:23AM (#9504822)
It could be rebased upstream. While it's a really bad practice, it could happen.
Re:Ask HN: Google/FB engineers, Do you like Mercurial? by lifebeyondfife on Thursday May 07, 2015 @09:29AM (#9504858)
Ah ok, I think I understand the concern. So 'git fetch' and 'git merge' explicitly will stop an upstream rebase from making destructive changes to the history of your local branch(?)

As you say it's bad practice and shouldn't happen. I use gitlab and GitHub where branches can be protected to only allow merges via their web interfaces.

Re:Ask HN: Google/FB engineers, Do you like Mercurial? by sytse on Thursday May 07, 2015 @09:38AM (#9504919)
GitLab CEO here, in GitLab you can protect branches to not be rebased at all (web or command line), see https://about.gitlab.com/2014/11/26/keeping-your-code-protec...

I'm not aware that GitHub offers the same functionality.

Re:Ask HN: Google/FB engineers, Do you like Mercurial? by c0wb0yc0d3r on Thursday May 07, 2015 @09:57AM (#9505037)
On the page where the ssh finger print is listed, can you list the RSA finger print too?

I am not well versed in working with git over ssh, but after following the instructions on GitLab to generate a key, then git would keep showing me the RSA finger print which doesn't match the one provided on the website. After looking around a bit, it looks like the one listed is ECDSA.

tl;dr: It was late. Finger prints didn't match. Only logical assumption was NSA. :P (Not really, obviously, but the finger prints could be more clear.)

Re:Ask HN: Google/FB engineers, Do you like Mercurial? by sytse on Thursday May 07, 2015 @10:06AM (#9505111)
Re:Ask HN: Google/FB engineers, Do you like Mercurial? by sytse on Friday May 08, 2015 @12:32PM (#9512591)
Re:Ask HN: Google/FB engineers, Do you like Mercurial? by gcb0 on Tuesday May 12, 2015 @09:19PM (#9536127)
but you still damage your local copy and it's a pain to clean up, specially if you had local changes/commits
Re:Ask HN: Google/FB engineers, Do you like Mercurial? by sytse on Wednesday May 13, 2015 @03:36AM (#9537368)
The idea is not to have upstream rebases so you can't pull them by accident.
Re:Ask HN: Google/FB engineers, Do you like Mercurial? by leni536 on Thursday May 07, 2015 @09:36AM (#9504905)
I don't think git pull would ever destroy your history (AFAIK it's exactly the same as a fetch+merge), at worst you end up in a merge conflict, but it's easily revertable. However after a git fetch and a git log you can see beforehand if there is anything nasty going on.
Re:Ask HN: Google/FB engineers, Do you like Mercurial? by ehotinger on Thursday May 07, 2015 @09:25AM (#9504840)
Nothing unless you're rebasing upstream, but I think the point he was trying to make was that you should always run `git fetch` and then `merge` from there (again, there are some situations where the pull is fine IMHO).
Re:Ask HN: Google/FB engineers, Do you like Mercurial? by c0wb0yc0d3r on Thursday May 07, 2015 @09:44AM (#9504953)
git pull just runs git fetch then git merge.

At least that is what the docs say: http://git-scm.com/docs/git-pull

What am I missing?

Re:Ask HN: Google/FB engineers, Do you like Mercurial? by gcb0 on Tuesday May 12, 2015 @09:17PM (#9536123)
but it tries to be smart about how to merge. and usually it's not what you want. i consider it the clippy of linus.

if you run merge/rebase/etc on its own, it will tell and ask you about anything out of the ordinary and then there's no surprise.

again, it's all about avoiding errors on the rare cases because you developed dangerous finger memory.

Re:Ask HN: Google/FB engineers, Do you like Mercurial? by lifebeyondfife on Thursday May 07, 2015 @09:30AM (#9504863)
Beat me to it.
Re:Ask HN: Google/FB engineers, Do you like Mercurial? by Kiro on Thursday May 07, 2015 @10:52AM (#9505454)
Why?
Re:Ask HN: Google/FB engineers, Do you like Mercurial? by gcb0 on Tuesday May 12, 2015 @09:14PM (#9536107)
nothing. but tomorrow, when you are used to type git pull, you will run it on a branch with changes and you have no idea if it will rebase, merge, fast forward... and /then/ you will see the problem. (and open yet another stackoverflow question on how to undo the last merge :)