git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.bash/aliases.bash3
-rw-r--r--.gitconfig2
-rw-r--r--.gnupg/gpg-agent.conf8
-rwxr-xr-xbin/git-other-branches12
-rwxr-xr-xbin/git-update-all17
m---------tmux-gpakosz0
6 files changed, 39 insertions, 3 deletions
diff --git a/.bash/aliases.bash b/.bash/aliases.bash
index dff312a..dd36794 100644
--- a/.bash/aliases.bash
+++ b/.bash/aliases.bash
@@ -227,6 +227,9 @@ for cmmd in batcat bat; do
break
fi
done
+if command -v 'thefuck' > /dev/null; then
+ alias wtf='thefuck $(fc -nl -1)'
+fi
# Flake8. Nice linter, but...
# They kneeled to USER STUPIDITY when it comes to configuration. Wut?
# https://flake8.pycqa.org/en/latest/release-notes/4.0.0.html#backwards-incompatible-changes
diff --git a/.gitconfig b/.gitconfig
index 9a9bb51..d43086f 100644
--- a/.gitconfig
+++ b/.gitconfig
@@ -70,6 +70,8 @@
cps = cherry-pick -S
force = push --force-with-lease
pf = push --force-with-lease
+ current-branch = rev-parse --abbrev-ref HEAD
+ cb = current-branch
[push]
default = simple
[pretty]
diff --git a/.gnupg/gpg-agent.conf b/.gnupg/gpg-agent.conf
index 1ec6b4b..2327757 100644
--- a/.gnupg/gpg-agent.conf
+++ b/.gnupg/gpg-agent.conf
@@ -1,14 +1,16 @@
ignore-cache-for-signing
#pinentry-program /usr/bin/pinentry-gtk-2
pinentry-program /usr/bin/pinentry-curses
-pinentry-timeout 5
+pinentry-timeout 15
allow-loopback-pinentry
allow-preset-passphrase
disable-scdaemon
-#max-cache-ttl 900
-#default-cache-ttl 900
enable-ssh-support
extra-socket /run/user/21337/gnupg/S.gpg-agent-extra
# programs like gnome-keyring would define their own values like
# pin timeout. That's going hydra/snowflake - disallow:
no-allow-external-cache
+# invalidate after n seconds, reaccessing resets timer
+default-cache-ttl 10
+# invalidate after n seconds even if timer has been reset in the meantime
+max-cache-ttl 60
diff --git a/bin/git-other-branches b/bin/git-other-branches
new file mode 100755
index 0000000..034670e
--- /dev/null
+++ b/bin/git-other-branches
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+GITBIN='/usr/bin/git'
+AWKBIN='/usr/bin/awk'
+GREPBIN='/usr/bin/grep'
+
+# 1. Pull the current branch and also tags, and prune references vanished from remote
+# shellcheck disable=SC2016
+"$GITBIN" branch --remotes |\
+ "$AWKBIN" '{print $1}' | "$AWKBIN" -F/ '{print $2}' |\
+ "$GREPBIN" -v "^$(git rev-parse --abbrev-ref HEAD)\$" |\
+ "$GREPBIN" -v '^HEAD$'
diff --git a/bin/git-update-all b/bin/git-update-all
new file mode 100755
index 0000000..d3f6033
--- /dev/null
+++ b/bin/git-update-all
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+
+GITBIN='/usr/bin/git'
+
+# 1. Pull the current branch and also tags, and prune references vanished from remote
+"$GITBIN" pull -tpf || exit 110
+# 2. Pull all branches existing locally
+mybr="$("$GITBIN" branch --show-current)"
+while read -r branch
+do
+ (
+ printf '\033[1m\033[3mSwitching to %b.\033[0m\n' "$branch"
+ "$GITBIN" switch "$branch" &&\
+ "$GITBIN" pull &&\
+ "$GITBIN" switch "$mybr"
+ )
+done < <("$GITBIN" branch --list|awk '{print $NF}'|grep -vP "^${mybr}\$")
diff --git a/tmux-gpakosz b/tmux-gpakosz
-Subproject e25f45ed3df5a83339fcfd99d256b0d1958d646
+Subproject af33f07134b76134acca9d01eacbdecca9c9cda