diff --git a/bin/git-alias b/bin/git-alias index 7d7437b9c..5a93f0d4a 100755 --- a/bin/git-alias +++ b/bin/git-alias @@ -2,6 +2,6 @@ case $# in 0) git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /' | sort ;; - 1) git alias | grep -e "$1" ;; + 1) git alias | grep -e -- "$1" ;; *) git config --global "alias.$1" "$2" ;; esac diff --git a/bin/git-contrib b/bin/git-contrib index b4320a362..1dbea523d 100755 --- a/bin/git-contrib +++ b/bin/git-contrib @@ -4,6 +4,6 @@ user="$*" test -z "$user" && echo "user name required." 1>&2 && exit 1 -count=`git log --oneline --pretty="format: %an" | grep "$user" | wc -l` +count=`git log --oneline --pretty="format: %an" | grep -- "$user" | wc -l` test $count -eq 0 && echo "$user did not contribute." && exit 1 -git shortlog | grep "$user (" -A $count +git shortlog | grep -- "$user (" -A $count diff --git a/bin/git-ignore b/bin/git-ignore index 09382973d..62207b2ac 100755 --- a/bin/git-ignore +++ b/bin/git-ignore @@ -32,7 +32,7 @@ function add_patterns { local file="${1/#~/$HOME}" for pattern in "${@:2}"; do echo "... adding '$pattern'" - (test -f "$file" && test "$pattern" && grep -q "$pattern" "$file") || echo "$pattern" >> "$file" + (test -f "$file" && test "$pattern" && grep -q -- "$pattern" "$file") || echo "$pattern" >> "$file" done } diff --git a/bin/git-scp b/bin/git-scp index 6ae829807..ae9737a94 100755 --- a/bin/git-scp +++ b/bin/git-scp @@ -18,7 +18,7 @@ function _test_git_scp() function set_remote() { remote=$1 - if [ $(git remote | grep -c ^$remote$) -eq 0 ] + if [ $(git remote | grep -c -- ^$remote$) -eq 0 ] then COLOR_RED echo "Remote $remote does not exist in your git config" diff --git a/bin/git-squash b/bin/git-squash index a240b0b6e..249db5ee9 100755 --- a/bin/git-squash +++ b/bin/git-squash @@ -14,7 +14,7 @@ is_commit_reference() { is_on_current_branch() { local commit_sha=`git rev-parse "$src"` git rev-list HEAD | - grep -q "$commit_sha" + grep -q -- "$commit_sha" } commit_if_msg_provided() { diff --git a/etc/bash_completion.sh b/etc/bash_completion.sh index 645ee06b2..fb780e0b7 100644 --- a/etc/bash_completion.sh +++ b/etc/bash_completion.sh @@ -69,7 +69,7 @@ _git_extras(){ } __git_extras_workflow(){ - __gitcomp "$(__git_heads | grep ^$1/ | sed s/^$1\\///g) finish" + __gitcomp "$(__git_heads | grep -- ^$1/ | sed s/^$1\\///g) finish" } _git_feature(){