Skip to content
2 changes: 1 addition & 1 deletion bin/git-delete-tag
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#
# Delete a tag, both locally and from the origin remote

git tag -d "$1" && git push origin ":refs/tags/$1"
exec git tag -d "$1" && git push origin ":refs/tags/$1"
11 changes: 8 additions & 3 deletions bin/git-github-open
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,18 @@ test -z "$FILE" -o "$FILE" = '--help' && {

# bail out with message to stderr and exit status 1
die() {
echo "$(basename $0):" "$@" 1>&2
exit 1
# shellcheck disable=SC2086
echo "$(basename $0):" "$@" 1>&2
exit 1
}

# figure out relative path to the file from the root
# of the work tree
# shellcheck disable=SC2086
path="$(basename $FILE)"
cd "$(dirname $FILE)"

# shellcheck disable=SC2046
cd $(dirname "$FILE")
while test ! -d .git ;
do
test "$(pwd)" = / && {
Expand Down Expand Up @@ -72,6 +76,7 @@ die "you're not tracking a remote branch"

# at this point we're in root of the work tree and $path is
# the relative path to file.
# shellcheck disable=SC2086
remote_url=$(git config --get remote.$remote.url)
repo=$(echo "$remote_url" | sed 's/^.*:\(.*\)\.git/\1/')
url="http://github.com/$repo/blob/$branch/$path"
Expand Down
1 change: 1 addition & 0 deletions bin/git-nuke
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# Examples
#
# git nuke add-git-nuke

set -o errexit

git branch -D "$1"
Expand Down
1 change: 1 addition & 0 deletions bin/git-pruneall
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

# shellcheck disable=SC2124
REMOTES="$@"

test -z "$REMOTES" &&
Expand Down
1 change: 1 addition & 0 deletions bin/git-purge-from-history
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ if [[ ! -d .git ]]; then
fi

# remove all paths passed as arguments from the history of the repo
# shellcheck disable=SC2124
files=$@
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch $files" HEAD

Expand Down