From 8ab70c4a10a0c964ef9da8351ee93e3eb3ad2fe8 Mon Sep 17 00:00:00 2001 From: Joe Block Date: Mon, 18 Sep 2017 09:59:50 -0600 Subject: [PATCH 1/7] Update doc in git-upstream-sync --- bin/git-upstream-sync | 1 + 1 file changed, 1 insertion(+) 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 From 4b601696fb013185fa4da6d8aa8acc29786aaa1f Mon Sep 17 00:00:00 2001 From: Joe Block Date: Mon, 18 Sep 2017 10:02:08 -0600 Subject: [PATCH 2/7] Quote bare variables in git-comma --- bin/git-comma | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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" From ec6ebba6c7290da43ccc228232e322c8497f8251 Mon Sep 17 00:00:00 2001 From: Joe Block Date: Mon, 18 Sep 2017 10:04:25 -0600 Subject: [PATCH 3/7] Make git-ignored return the underlying exit code --- bin/git-ignored | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 87054e9ec0557449ae673889777c91999641f5dc Mon Sep 17 00:00:00 2001 From: Joe Block Date: Mon, 18 Sep 2017 10:05:54 -0600 Subject: [PATCH 4/7] return underlying exit code --- bin/git-nuke-untracked-files | 1 + 1 file changed, 1 insertion(+) 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 $? From a2beec7d31da181a3b56891cc5b986d5060cafee Mon Sep 17 00:00:00 2001 From: Joe Block Date: Mon, 18 Sep 2017 10:07:31 -0600 Subject: [PATCH 5/7] Clean quoting; remove extra space in command --- bin/git-purge-from-history | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 From fdc049c5e66041ff8688d2747d35392a22fb31e5 Mon Sep 17 00:00:00 2001 From: Joe Block Date: Mon, 18 Sep 2017 10:09:19 -0600 Subject: [PATCH 6/7] Make git-root-directory return useful exit code --- bin/git-root-directory | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 65cfd650df1c021f77fcad2d50280ed4ff5e9358 Mon Sep 17 00:00:00 2001 From: Joe Block Date: Mon, 18 Sep 2017 10:10:54 -0600 Subject: [PATCH 7/7] Quote bare variables in git-submodule-rm --- bin/git-submodule-rm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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