From 0de6b9edf1820050d41c547e7b7e31386de37219 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Sun, 19 Sep 2021 23:38:29 +0200 Subject: [PATCH] Reload gpg-agent before some git commands --- zshrc | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/zshrc b/zshrc index 7ec9131..500d97d 100644 --- a/zshrc +++ b/zshrc @@ -179,8 +179,6 @@ alias pbin='~/repos/cpaste/cpaste --sourcecode --expire 1week --file ' ## Git aliases − Try to prefix with 'gg' {{{ ### Get status of the repo alias ggstatus='git status' -### Download any new commits -alias ggpull='git pull' ### Show differences between changes and index alias ggdiff='git diff' ### Show only words/characters differences @@ -193,13 +191,6 @@ alias ggrm='git rm' alias ggmv='git mv' ### Cancel changes alias ggcheckout='git checkout --' -### Commit changes -alias ggco='git commit' -alias ggcommit='git commit' -### Amend changes -alias ggamend='git commit --amend' -### Update remote repository -alias ggpush='git push' ### Print lines matching a pattern alias ggrep='git grep --color -n -P' alias gggrep='git grep --color -n -P' @@ -211,6 +202,17 @@ alias gglg="git --no-pager log --graph --pretty=tformat:'%Cred%h%Creset -%C(auto alias ggllg="git log --graph --pretty=tformat:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%an %ar)%Creset'" ### Display all commits/changes of a file alias ggchanges="git log --follow -p --" + +### Commands that might require a valid gpg-agent +#### Download any new commits +alias ggpull='load-gpg-agent && git pull' +#### Commit changes +alias ggco='load-gpg-agent && git commit' +alias ggcommit='load-gpg-agent && git commit' +#### Amend changes +alias ggamend='load-gpg-agent && git commit --amend' +#### Update remote repository +alias ggpush='load-gpg-agent && git push' ## }}} # Lister les fichiers de configuration inutiles @@ -376,7 +378,7 @@ alias scpdev='scp -o UserKnownHostsFile=/dev/null' # GPG {{{ ######### -# Load gpg-agent {{{ +# (re)Load gpg-agent {{{ ## This function can be used : ## 1. with aliases (git commit,…) function load-gpg-agent() {