Stream: general

Topic: git pr


davidtwco (Nov 07 2018 at 15:16, on Zulip):

Remembered a git alias I've got that people here might find useful:

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

Running git pr 33333 would fetch that PR.

davidtwco (Nov 07 2018 at 15:17, on Zulip):

(assuming the remote you have for rust-lang/rust is called upstream)

Wesley Wiser (Nov 07 2018 at 15:29, on Zulip):

You might also be interested in hub https://hub.github.com/

nagisa (Nov 07 2018 at 15:45, on Zulip):

I have this in my .git/config:

nagisa (Nov 07 2018 at 15:46, on Zulip):
[remote "origin"]
    url = https://github.com/rust-lang/rust.git
    fetch = +refs/heads/*:refs/remotes/origin/*
    fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
nagisa (Nov 07 2018 at 15:46, on Zulip):

so with every git fetch origin I get not only the updated heads for branches, but also all the PRs.

nagisa (Nov 07 2018 at 15:47, on Zulip):

In action:

$ git fetch origin
remote: Enumerating objects: 3220, done.
remote: Counting objects: 100% (3220/3220), done.
remote: Compressing objects: 100% (123/123), done.
remote: Total 4289 (delta 3149), reused 3140 (delta 3097), pack-reused 1069
Receiving objects: 100% (4289/4289), 1.72 MiB | 2.85 MiB/s, done.
Resolving deltas: 100% (3574/3574), completed with 976 local objects.
From https://github.com/rust-lang/rust
   757d6cc91a6..b79e5eec705  auto                 -> origin/auto
   3fc70e8d468..8315b11b635  master               -> origin/master
   da5f414c2c0..1433507eba7  stable               -> origin/stable
 + 5f8bd0aff7b...3af441bb024 try                  -> origin/try  (forced update)
   cfc8d2c7164..3de5f1c0b91  refs/pull/53506/head -> origin/pr/53506
   bfc4b41b78b..ddde8346d65  refs/pull/53645/head -> origin/pr/53645
   35bbcf14f4c..f8723036235  refs/pull/53996/head -> origin/pr/53996
 + 02b67a429d6...8960b0f1201 refs/pull/54125/head -> origin/pr/54125  (forced update)
 + 5f8bd0aff7b...3af441bb024 refs/pull/54633/head -> origin/pr/54633  (forced update)
   1fff3e3e508..906dedc9170  refs/pull/54668/head -> origin/pr/54668
 + d2f2446e9f6...50c7e80d217 refs/pull/54864/head -> origin/pr/54864  (forced update)
 + e251995e710...d60290fc63b refs/pull/54922/head -> origin/pr/54922  (forced update)
 + 8e2b70e269d...3d27aca8412 refs/pull/55106/head -> origin/pr/55106  (forced update)
 + d461857626e...b1cbdb136ae refs/pull/55136/head -> origin/pr/55136  (forced update)
 + a6801803b63...5238d0437e7 refs/pull/55327/head -> origin/pr/55327  (forced update)
 + a38a6d09b10...c5ed72fbfe8 refs/pull/55330/head -> origin/pr/55330  (forced update)
 + adafd0f9a04...9e479c2818e refs/pull/55349/head -> origin/pr/55349  (forced update)
 + db40bedbc42...02d50de63e5 refs/pull/55366/head -> origin/pr/55366  (forced update)
 + 4e3771b00fa...8740adbf1e6 refs/pull/55367/head -> origin/pr/55367  (forced update)
 + 83d4a3a704e...0ffaa6cc313 refs/pull/55402/head -> origin/pr/55402  (forced update)
   5e50acf443e..99f7dc451fb  refs/pull/55410/head -> origin/pr/55410
   a7bea73292c..22b571d62a6  refs/pull/55495/head -> origin/pr/55495
<snip>
Last update: Nov 22 2019 at 00:15UTC