about summary refs log tree commit diff stats
path: root/nix-conf/home/includes/zsh.nix
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2023-01-12 12:12:53 +0000
committerDavid Morgan <djm_uk@protonmail.com>2023-01-12 12:12:53 +0000
commite244cf50be5ef02d988889818ae283f4fe6c944e (patch)
tree847fb6ba5a859f187960323574c16e1a5eda4081 /nix-conf/home/includes/zsh.nix
parent1a38ff654ac1a42bc6eb70b8af5f297f2e62cc42 (diff)
downloaddotfiles-e244cf50be5ef02d988889818ae283f4fe6c944e.tar.gz
Add checkout-pr function
Diffstat (limited to 'nix-conf/home/includes/zsh.nix')
-rw-r--r--nix-conf/home/includes/zsh.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/nix-conf/home/includes/zsh.nix b/nix-conf/home/includes/zsh.nix
index 93fdb2d..7a01868 100644
--- a/nix-conf/home/includes/zsh.nix
+++ b/nix-conf/home/includes/zsh.nix
@@ -192,6 +192,11 @@
         df -h
       }
 
+      function checkout-pr () {
+        git fetch ''${2:-upstream} pull/''${1}/head:pr-''${1}
+        git switch pr-''${1}
+      }
+
       [[ ! -f ~/.zsh.local ]] || source ~/.zsh.local
 
       [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh