Stream: general

Topic: slow-git


Dale Wijnand (Sep 13 2018 at 09:49, on Zulip):

Not sure if this is worth putting in the rustc-guide somewhere, but I just found out that the reason git (and tig) were slow for me was because I had my global .gitconfig configured to download all the pull request references:

[remote "origin"]
  fetch = +refs/pull/*:refs/remotes/pull/*

and that was massively slowing down git. Removing that setup and deleting all the remote-tracking local branches made everything better. :)

Dale Wijnand (Sep 13 2018 at 09:50, on Zulip):

(about ~55k local branches - 2x the number of pull requests ever)

Santiago Pastorino (Sep 13 2018 at 13:37, on Zulip):

@Dale Wijnand interesting, anyway, that's not the default setting

Santiago Pastorino (Sep 13 2018 at 13:37, on Zulip):

or was it generated by default to you with some specific tool?

Santiago Pastorino (Sep 13 2018 at 13:37, on Zulip):

if you do git clone it does not generate that

Dale Wijnand (Sep 13 2018 at 13:40, on Zulip):

No indeed it's not a default setting and git cloning doesn't generate that.

GitHub documents these special references it uses in https://help.github.com/articles/checking-out-pull-requests-locally/, so with a little know-how someone crafted that and passed it on.

Santiago Pastorino (Sep 13 2018 at 15:06, on Zulip):

:+1:

Jake Goulding (Sep 14 2018 at 13:40, on Zulip):

@Dale Wijnand I use this instead:

[alias]
        pr = "!f() { git fetch -fu upstream refs/pull/$1/head:pr/$1; git checkout pr/$1; } ; f"

And then just git pr 1234

Dale Wijnand (Sep 14 2018 at 13:41, on Zulip):

I use https://hub.github.com/, and then git checkout https://github.com/rust-lang/rust/pull/1234.

Last update: Nov 20 2019 at 11:30UTC