Skip to content

Commit a16e712

Browse files
committed
Merge remote-tracking branch 'origin/master' into more-codeclimate-cleanup
2 parents 68ddd0b + 7c5441d commit a16e712

File tree

5 files changed

+36
-38
lines changed

5 files changed

+36
-38
lines changed

bin/git-find-dirty

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@
44

55
IFS=$'\n'
66

7-
fail() {
8-
echo "$@"
9-
exit 1
10-
}
11-
127
for gitprojpath in $(find . -type d -name .git | sort | sed "s/\/\.git//"); do
138
pushd . > /dev/null
14-
cd "$gitprojpath" || fail "could not cd to $gitprojpath"
9+
cd "$gitprojpath" || continue
1510
isdirty=$(git status -s | grep "^.*")
1611
if [ -n "$isdirty" ]; then
1712
echo "DIRTY:" "$gitprojpath"

bin/git-git

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99

1010
if [[ "$1" == 'git' ]]; then
1111
shift # chop off the extra git
12+
# shellcheck disable=SC2068
1213
exec git $@
1314
fi

bin/git-overwritten

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ abort() {
3333
while [ "$#" -gt 0 ]; do
3434
case "$1" in
3535
--color ) colorize=1 ;;
36-
--no-color ) colorize= ;;
36+
--no-color ) colorize='';;
3737
--staged ) diff_type='--staged' ;;
38-
--unstaged ) diff_type= ;;
38+
--unstaged ) diff_type='';;
3939
-h | --help )
4040
sed -ne '/^#/!q;s/.\{1,2\}//;1d;p' < "$0"
4141
exit 0
@@ -127,4 +127,4 @@ git diff ${diff_type-"${base}...${head}"} --diff-filter=DM --no-prefix -w -U0 |
127127
printf ': '
128128
echo "$msg"
129129
done
130-
} | sort -r | uniq -c
130+
} | sort -r | uniq -c

bin/git-prune-branches

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,39 +17,39 @@
1717
merged=$(git branch --no-color --merged master | grep -v master | sed 's/\*/ /')
1818

1919
if [ ! -z "$merged" ] ; then
20-
echo "Deleting the following merged branches:"
21-
for branch in $merged ; do
22-
echo " " "$branch"
23-
done
20+
echo "Deleting the following merged branches:"
21+
for branch in $merged ; do
22+
echo " " "$branch"
23+
done
2424

25-
all=n
25+
all=n
26+
delete=n
27+
for branch in $merged ; do
28+
if [ $all = 'n' ] ; then
2629
delete=n
27-
for branch in $merged ; do
28-
if [ $all = 'n' ] ; then
29-
delete=n
30-
# shellcheck disable=SC2162
31-
read -p "Delete $branch (y=yes, n=no, a=all)? " prompt
32-
echo "all=$all delete=$delete prompt=$prompt"
33-
if [ "$prompt" = 'a' ] ; then
34-
delete=y
35-
all=y
36-
elif [ "$prompt" = 'y' ]; then
37-
delete=y
38-
fi
30+
# shellcheck disable=SC2162
31+
read -p "Delete $branch (y=yes, n=no, a=all)? " prompt
32+
echo "all=$all delete=$delete prompt=$prompt"
33+
if [ "$prompt" = 'a' ] ; then
34+
delete=y
35+
all=y
36+
elif [ "$prompt" = 'y' ]; then
37+
delete=y
3938
fi
39+
fi
4040

41-
if [ "$delete" = 'y' ] ; then
42-
git branch -d "$branch"
43-
fi
44-
done
41+
if [ "$delete" = 'y' ] ; then
42+
git branch -d "$branch"
43+
fi
44+
done
4545
fi
4646

4747
remotes=$(git remote)
4848
for remote in $remotes ; do
49-
prompt=n
50-
# shellcheck disable=SC2162
51-
read -p "Prune deleted branches from remote '$remote' (y=yes n=no)? " prompt
52-
if [ "$prompt" = 'y' ] ; then
53-
git remote prune "$remote"
54-
fi
49+
prompt=n
50+
# shellcheck disable=SC2162
51+
read -p "Prune deleted branches from remote '$remote' (y=yes n=no)? " prompt
52+
if [ "$prompt" = 'y' ] ; then
53+
git remote prune "$remote"
54+
fi
5555
done

bin/git-rel

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
# Original source: http://github.com/rtomayko/dotfiles
33
# Usage: git-rel [<ref>]
44
# Shows the relationship between the current branch and <ref>. With no <ref>,
@@ -13,7 +13,9 @@
1313
# $ git-rel v1.1
1414
# 230 ahead
1515

16+
# shellcheck disable=SC2046,SC2086
1617
strip_prefix () {
18+
# shellcheck disable=SC2001
1719
echo "$@" |
1820
sed 's@refs/heads/@@'
1921
}
@@ -31,7 +33,7 @@ tracking_branch () {
3133

3234
ref="${1:-$(tracking_branch)}"
3335

34-
git rev-list --left-right --abbrev-commit --abbrev $ref...HEAD |
36+
git rev-list --left-right --abbrev-commit --abbrev "$ref"...HEAD |
3537
cut -c1 |
3638
sort |
3739
uniq -c |

0 commit comments

Comments
 (0)