diff options
| author | Robert Günzler <r@gnzler.io> | 2021-01-29 14:55:24 +0100 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2021-01-29 14:55:24 +0100 |
| commit | ef2e08b2b9eead9119f916464182fca652ef3fef (patch) | |
| tree | 20c769747dda7400458df4627b49bfb83ebd921e /.config/git/config | |
| parent | dc9537632380d8f31d6e89efd8518064bf1c4302 (diff) | |
git: fix credential impls and error out when missing arg on pr alias
Diffstat (limited to '.config/git/config')
| -rw-r--r-- | .config/git/config | 8 |
1 files changed, 4 insertions, 4 deletions
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 <num> [<remote>] # creates local branch pr/<num> from origin or <remote> 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" |