From ef2e08b2b9eead9119f916464182fca652ef3fef Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Fri, 29 Jan 2021 14:55:24 +0100 Subject: git: fix credential impls and error out when missing arg on pr alias --- .config/git/config | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to '.config/git/config') diff --git a/.config/git/config b/.config/git/config index 631a82a..5370deb 100644 --- a/.config/git/config +++ b/.config/git/config @@ -18,15 +18,15 @@ [credential "git.sr.ht"] username = robertgzr - helper = !sh -c 'pass sr.ht/robertgzr | xargs printf "password=%s\n"' + helper = !sh -c 'pass sr.ht/robertgzr | head -n1 | xargs printf "password=%s\n"' [credential "github.com"] username = robertgzr - helper = !sh -c 'pass github.com/robertgzr | xargs printf "password=%s\n"' + helper = !sh -c 'pass github.com/robertgzr | head -n1 | xargs printf "password=%s\n"' [credential "smtp://mail.gandi.net:465"] username = robert@gnzler.io - helper = !sh -c 'pass email/gnzler.io | xargs printf "password=%s\n"' + helper = !sh -c 'pass email/gnzler.io | head -n1 | xargs printf "password=%s\n"' [core] excludesfile = ~/.git/ignore @@ -87,7 +87,7 @@ log-since = "!sh -c \"git log --since '${1:-1} days ago' --oneline --author $(git config user.email)\" -" # usage: pr [] # creates local branch pr/ from origin or and checks it out - pr = "!f() { git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f" + pr = "!f() { git fetch -fu ${2:-origin} refs/pull/${1:?missing pr num}/head:pr/$1 && git checkout pr/$1; }; f" total-lines = "! git ls-tree -r master --name-only | xargs -I {} git blame --line-porcelain {} | sed -n 's/^author //p' | sort | uniq -c | sort -rn" fixup = "!f() { git commit --fixup=${1}; }; f" squash = "!f() { git commit --squash=${1}; }; f" -- cgit 1.4.1