diff --git a/bin/git-comma b/bin/git-comma index a200447c2..4381ab100 100755 --- a/bin/git-comma +++ b/bin/git-comma @@ -8,11 +8,11 @@ added=() # add unknown files... for arg; do - if [[ -f $arg && -n $(git ls-files -o $arg) ]]; then - git add $arg + if [[ -f "$arg" && -n $(git ls-files -o "$arg") ]]; then + git add "$arg" added+=($arg) fi done # ...reset them when commit is aborted -git commit ${@:+-o} "$@" || git reset -q -- $added +git commit ${@:+-o} "$@" || git reset -q -- "$added" diff --git a/bin/git-ignored b/bin/git-ignored index 1c81a76bd..9ff4b6898 100755 --- a/bin/git-ignored +++ b/bin/git-ignored @@ -2,4 +2,4 @@ # # Show what files are being ignored in the repo -git ls-files --others --i --exclude-standard +exec git ls-files --others --i --exclude-standard diff --git a/bin/git-nuke-untracked-files b/bin/git-nuke-untracked-files index 4512485bc..3642c7ab1 100755 --- a/bin/git-nuke-untracked-files +++ b/bin/git-nuke-untracked-files @@ -7,3 +7,4 @@ set -o pipefail git status -su | cut -d' ' -f2- | tr '\n' '\0' | xargs -0 rm +exit $? diff --git a/bin/git-purge-from-history b/bin/git-purge-from-history index 0b8f07f3c..251925d99 100755 --- a/bin/git-purge-from-history +++ b/bin/git-purge-from-history @@ -10,13 +10,13 @@ set -o errexit # if [[ $# -eq 0 ]]; then - echo "You must specify a file/directory to purge from your git history" + echo 'You must specify a file/directory to purge from your git history' exit 1 fi # make sure we're at the root of git repo if [[ ! -d .git ]]; then - echo "Error: must run this script from the root of a git repository" + echo 'Error: must run this script from the root of a git repository' exit 1 fi @@ -26,4 +26,4 @@ files=$@ git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch $files" HEAD # remove the temporary history git-filter-branch otherwise leaves behind for a long time -rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune +rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune diff --git a/bin/git-root-directory b/bin/git-root-directory index ff18031d2..920666009 100755 --- a/bin/git-root-directory +++ b/bin/git-root-directory @@ -2,4 +2,4 @@ # # Print the root of the git checkout you're in. -git rev-parse --show-toplevel +exec git rev-parse --show-toplevel diff --git a/bin/git-submodule-rm b/bin/git-submodule-rm index 7d78c3568..2ff3d6dc9 100755 --- a/bin/git-submodule-rm +++ b/bin/git-submodule-rm @@ -10,9 +10,9 @@ if [[ -e $(pwd)/.gitmodules ]]; then echo 'Usage: git submodule-rm ' else for submodulepath in $@; do - git config -f .git/config --remove-section submodule.$submodulepath - git config -f .gitmodules --remove-section submodule.$submodulepath - git rm --cached $submodulepath + git config -f .git/config --remove-section "submodule.$submodulepath" + git config -f .gitmodules --remove-section "submodule.$submodulepath" + git rm --cached "$submodulepath" done fi else diff --git a/bin/git-upstream-sync b/bin/git-upstream-sync index f681029f1..9fb363373 100755 --- a/bin/git-upstream-sync +++ b/bin/git-upstream-sync @@ -5,6 +5,7 @@ # https://github.com/unixorn/git-extra-commands/blob/master/LICENSE # # Sync to upstream/yourforkname and rebase into your local fork. then push +# back into yourfork/yourforkname # # Assumes that your upstream fork's remote is named upstream