From 75058ebf22d3887caa88a5b2157d869d74b52bbd Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Tue, 2 Feb 2021 13:28:56 +0200 Subject: [PATCH] plugins: git: Fix git_stats Also remove uneeded newline --- plugins/available/git.plugin.bash | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/plugins/available/git.plugin.bash b/plugins/available/git.plugin.bash index 333d3a02..e4efc3fe 100644 --- a/plugins/available/git.plugin.bash +++ b/plugins/available/git.plugin.bash @@ -1,5 +1,4 @@ # shellcheck shell=bash - cite about-plugin about-plugin 'git helper functions' @@ -188,13 +187,17 @@ function git_stats { echo '-------------------' echo "Statistics for: $a" echo -n "Number of files changed: " - git log "$LOGOPTS" --all --numstat --format="%n" --author="$a" | cut -f3 | sort -iu | wc -l + # shellcheck disable=SC2086 + git log $LOGOPTS --all --numstat --format="%n" --author="$a" | cut -f3 | sort -iu | wc -l echo -n "Number of lines added: " - git log "$LOGOPTS" --all --numstat --format="%n" --author="$a" | cut -f1 | awk '{s+=$1} END {print s}' + # shellcheck disable=SC2086 + git log $LOGOPTS --all --numstat --format="%n" --author="$a" | cut -f1 | awk '{s+=$1} END {print s}' echo -n "Number of lines deleted: " - git log "$LOGOPTS" --all --numstat --format="%n" --author="$a" | cut -f2 | awk '{s+=$1} END {print s}' + # shellcheck disable=SC2086 + git log $LOGOPTS --all --numstat --format="%n" --author="$a" | cut -f2 | awk '{s+=$1} END {print s}' echo -n "Number of merges: " - git log "$LOGOPTS" --all --merges --author="$a" | grep -c '^commit' + # shellcheck disable=SC2086 + git log $LOGOPTS --all --merges --author="$a" | grep -c '^commit' done else echo "you're currently not in a git repository"