From 98c54443e9aa8a4b99abc8205c1b2354ec88fc55 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 10 Feb 2025 12:08:29 +0100 Subject: [PATCH] git: Add pr alias which fetches a specific github pull request Used like `g pr 1234` to create local pr/1234 branch. --- vcs/git/config/git/config | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vcs/git/config/git/config b/vcs/git/config/git/config index c73b86d..6164279 100644 --- a/vcs/git/config/git/config +++ b/vcs/git/config/git/config @@ -30,12 +30,14 @@ delta = "![ $TERM_DARK = false ] && delta --light || delta" # Take care that we always display right color scheme # check out a github PR directly on the commandline, creates pr/4 or pr/ branch locally - pr = "!f() { git fetch -fu ${2:-$(git remote |grep ^github || echo origin)} refs/pull/$1/head:pr/$1 }; f" + pr = "!f() { git fetch -fu ${2:-$(git remote |grep ^github || echo origin)} refs/pull/$1/head:pr/$1 }; f" # remove all pr/ local branches - pr-clean = "!git for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done" + pr-clean = "!git for-each-ref refs/heads/pr/* --format = '%(refname)' | while read ref ; do branch = ${ref#refs/heads/} ; git branch -D $branch ; done" [commit] gpgsign = true # sign commits as me verbose = true # Always show diff when preparing commit message +[tag] + gpgsign = true [fetch] prune = true # remove references to non-existent remote branches [pull] @@ -45,7 +47,7 @@ [difftool] prompt = false [difftool "difftastic"] - cmd = difft "$LOCAL" "$REMOTE" + cmd = difft "$LOCAL" "$REMOTE" [color "diff"] meta = "9" frag = "magenta bold"