style: "echo ''" -> "echo"

This commit is contained in:
Emile Clark-Boman 2025-07-25 13:17:58 +10:00
parent de49956a53
commit 32e66c2329

26
bin/g
View file

@ -235,30 +235,30 @@ fi
current_branch=$(git rev-parse --abbrev-ref HEAD) current_branch=$(git rev-parse --abbrev-ref HEAD)
if [[ "$current_branch" == "$2" ]]; then if [[ "$current_branch" == "$2" ]]; then
if confirm "You are currently on the branch '$2'! Do you want me to switch to 'master'?"; then if confirm "You are currently on the branch '$2'! Do you want me to switch to 'master'?"; then
echo '' echo
git checkout master git checkout master
else else
echo '' echo
fi fi
fi fi
git branch -d "$2" &>/dev/null git branch -d "$2" &>/dev/null
if [[ "$?" -ne 0 ]]; then if [[ "$?" -ne 0 ]]; then
if confirm "The branch '$2' hasn't been merged. Are sure you want to delete this branch?"; then if confirm "The branch '$2' hasn't been merged. Are sure you want to delete this branch?"; then
echo '' echo
git branch -D "$2" git branch -D "$2"
else else
echo '' echo
fi fi
fi fi
ls $(git_root)/.git/refs/remotes/*/$2 &>/dev/null ls $(git_root)/.git/refs/remotes/*/$2 &>/dev/null
if [[ "$?" -eq 0 ]]; then if [[ "$?" -eq 0 ]]; then
if confirm 'Would you like to delete this branch on the remote as well?'; then if confirm 'Would you like to delete this branch on the remote as well?'; then
echo '' echo
git push origin --delete "$2" git push origin --delete "$2"
else else
echo '' echo
echo 'OK, just thought I'"'"'d ask.' echo 'OK, just thought I'"'"'d ask.'
fi fi
fi fi
@ -332,10 +332,10 @@ for local_branch in $branches; do
# Detect and delete branches not on remote # Detect and delete branches not on remote
else else
if confirm "Failed to fast forward local branch '$local_branch'. Do you want to delete the local branch if it's merged?"; then if confirm "Failed to fast forward local branch '$local_branch'. Do you want to delete the local branch if it's merged?"; then
echo '' echo
git branch -d "$local_branch" git branch -d "$local_branch"
else else
echo '' echo
fi fi
fi fi
fi fi
@ -415,10 +415,10 @@ if [ ! -z "$tags" ]; then
if confirm "Would you like to push these tags (${tags}) to the remote as well?"; then if confirm "Would you like to push these tags (${tags}) to the remote as well?"; then
local_branch=$(git rev-parse --abbrev-ref HEAD) local_branch=$(git rev-parse --abbrev-ref HEAD)
remote=$(git config --get branch.$local_branch.remote) remote=$(git config --get branch.$local_branch.remote)
echo '' echo
follow_tags='--follow-tags' follow_tags='--follow-tags'
else else
echo '' echo
echo 'OK, just thought I'"'"'d ask.' echo 'OK, just thought I'"'"'d ask.'
fi fi
fi fi
@ -557,13 +557,13 @@ git log --color \
| sed 's/<validity-Y>/expired/g' \ | sed 's/<validity-Y>/expired/g' \
| sed 's/<validity-B>/bad/g' \ | sed 's/<validity-B>/bad/g' \
| sed 's/<validity-E>/error/g' | sed 's/<validity-E>/error/g'
echo '' echo
;; ;;
hist) hist)
git reflog HEAD@{now} --date=relative \ git reflog HEAD@{now} --date=relative \
|awk '$5 ~ /checkout:/ { sub(/HEAD@/, "", $2); sub(/:/, "", $4); if (!seen[$10]++) print $10, $2, $3, $4}' |awk '$5 ~ /checkout:/ { sub(/HEAD@/, "", $2); sub(/:/, "", $4); if (!seen[$10]++) print $10, $2, $3, $4}'
echo '' echo
;; ;;
submodule) submodule)
@ -587,7 +587,7 @@ do
echo "url = $url" echo "url = $url"
cd "$gitroot" cd "$gitroot"
git submodule add "$url" "$reldir" git submodule add "$url" "$reldir"
echo '' echo
done done
cd "$gitroot" cd "$gitroot"
git submodule init git submodule init