9c84c344d762b200de7acc794b9a0e7832144e7a

Author
Marc Cornellà <hello@mcornella.com>
Committer
Marc Cornellà <hello@mcornella.com>
Date

Message

fix: disable `log.showSignature` in `git log` calls

Diff

 1diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
 2index 648fa0a33daba64e1985b8b74a1e14afb29c6350..8f7e623ec4bd9cce2278513e604a1b2b6590b755 100644
 3--- a/plugins/git/git.plugin.zsh
 4+++ b/plugins/git/git.plugin.zsh
 5@@ -24,9 +24,7 @@ compdef _git _git_log_prettily=git-log
 6 
 7 # Warn if the current branch is a WIP
 8 function work_in_progress() {
 9-  if $(git log -n 1 2>/dev/null | grep -q -c "\-\-wip\-\-"); then
10-    echo "WIP!!"
11-  fi
12+  command git -c log.showSignature=false log -n 1 2>/dev/null | grep -q -- "--wip--" && echo "WIP!!"
13 }
14 
15 # Check if main exists and use instead of master
16diff --git a/themes/Soliah.zsh-theme b/themes/Soliah.zsh-theme
17index 070c5498164cc7bcf7d95e0cb44ca131b4f65702..c3dd6af89b8cd11e1a88a4932dc598de9c8bf31f 100644
18--- a/themes/Soliah.zsh-theme
19+++ b/themes/Soliah.zsh-theme
20@@ -45,9 +45,7 @@ function rvm_gemset() {
21 function git_time_since_commit() {
22     if git rev-parse --git-dir > /dev/null 2>&1; then
23         # Only proceed if there is actually a commit.
24-        if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then
25-            # Get the last commit.
26-            last_commit=`git log --pretty=format:'%at' -1 2> /dev/null`
27+        if last_commit=`git -c log.showSignature=false log --pretty=format:'%at' -1 2> /dev/null`; then
28             now=`date +%s`
29             seconds_since_last_commit=$((now-last_commit))
30 
31diff --git a/themes/avit.zsh-theme b/themes/avit.zsh-theme
32index d117c4e94e507447fec4ba18d13d31b328ebded5..f90ba331b92c0f8e3fb595898a7bcf4033439541 100644
33--- a/themes/avit.zsh-theme
34+++ b/themes/avit.zsh-theme
35@@ -31,7 +31,7 @@ function _git_time_since_commit() {
36   local last_commit now seconds_since_last_commit
37   local minutes hours days years commit_age
38   # Only proceed if there is actually a commit.
39-  if last_commit=$(command git -c log.showSignatures=false log --format='%at' -1 2>/dev/null); then
40+  if last_commit=$(command git -c log.showSignature=false log --format='%at' -1 2>/dev/null); then
41     now=$(date +%s)
42     seconds_since_last_commit=$((now-last_commit))
43 
44diff --git a/themes/dogenpunk.zsh-theme b/themes/dogenpunk.zsh-theme
45index 6a9921288a8b04024d6bb16d45f36841fb396bd0..923ca74bcceddcce3ade64f1ad1e01543a76ea0d 100644
46--- a/themes/dogenpunk.zsh-theme
47+++ b/themes/dogenpunk.zsh-theme
48@@ -37,9 +37,7 @@ ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}"
49 function git_time_since_commit() {
50     if git rev-parse --git-dir > /dev/null 2>&1; then
51         # Only proceed if there is actually a commit.
52-        if git log -n 1  > /dev/null 2>&1; then
53-            # Get the last commit.
54-            last_commit=`git log --pretty=format:'%at' -1 2> /dev/null`
55+        if last_commit=`git -c log.showSignature=false log --pretty=format:'%at' -1 2> /dev/null`; then
56             now=`date +%s`
57             seconds_since_last_commit=$((now-last_commit))
58 
59diff --git a/themes/smt.zsh-theme b/themes/smt.zsh-theme
60index 7f54472c6b55407bde66ac1ff38ce02d9860e322..52e6d9a21d7239fd3f2d41590370619b44775af5 100644
61--- a/themes/smt.zsh-theme
62+++ b/themes/smt.zsh-theme
63@@ -40,7 +40,7 @@ function git_time_since_commit() {
64     local last_commit seconds_since_last_commit
65 
66     # Only proceed if there is actually a commit
67-    if ! last_commit=$(command git log --pretty=format:'%at' -1 2>/dev/null); then
68+    if ! last_commit=$(command git -c log.showSignature=false log --pretty=format:'%at' -1 2>/dev/null); then
69         echo "[$ZSH_THEME_GIT_TIME_SINCE_COMMIT_NEUTRAL~%{$reset_color%}]"
70         return
71     fi
72diff --git a/themes/wedisagree.zsh-theme b/themes/wedisagree.zsh-theme
73index 07006ecd9574d465c12cc739cc11618da7ef6a47..e9e9d6ef8a0672dfae5c885f312ae99cbfbfb269 100644
74--- a/themes/wedisagree.zsh-theme
75+++ b/themes/wedisagree.zsh-theme
76@@ -69,9 +69,7 @@ function rvm_gemset() {
77 function git_time_since_commit() {
78     if git rev-parse --git-dir > /dev/null 2>&1; then
79         # Only proceed if there is actually a commit.
80-        if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then
81-            # Get the last commit.
82-            last_commit=`git log --pretty=format:'%at' -1 2> /dev/null`
83+        if last_commit=`git -c log.showSignature=false log --pretty=format:'%at' -1 2> /dev/null`; then
84             now=`date +%s`
85             seconds_since_last_commit=$((now-last_commit))
86 
87diff --git a/tools/changelog.sh b/tools/changelog.sh
88index 664f346081b2441b047f08d400b4c497deb653e9..86774a7ea1bdccfab5f2b2c242c823f9fd09f122 100755
89--- a/tools/changelog.sh
90+++ b/tools/changelog.sh
91@@ -414,7 +414,7 @@ function main {
92   # --first-parent: commits from merged branches are omitted
93   local SEP="0mZmAgIcSeP"
94   local -a raw_commits
95-  raw_commits=(${(0)"$(command git log -z \
96+  raw_commits=(${(0)"$(command git -c log.showSignature=false log -z \
97     --format="%h${SEP}%D${SEP}%s${SEP}%b" --abbrev=7 \
98     --no-merges --first-parent $range)"})
99