Author SHA1 Message Date
d793da180e feat(git): add grbia alias for interactive rebase with autosquash
`grbia` runs `git rebase --interactive --autosquash`, following the
existing `grbmia` naming. It has been proposed several times over the
years; this lands it and credits everyone who tried.

Fixes #13865

Co-authored-by: Tushar Mathur <194482+tusharmath@users.noreply.github.com>
Co-authored-by: Thomas Raimond <10564970+ThamosIO@users.noreply.github.com>
Co-authored-by: Clément <59260989+clegoffic@users.noreply.github.com>
Co-authored-by: Gaurav Yadav <160158213+MeGaurav4@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 17:25:45 -07:00
3 changed files with 16 additions and 61 deletions
+1
View File
@@ -156,6 +156,7 @@ plugins=(... git)
| `grba` | `git rebase --abort` |
| `grbc` | `git rebase --continue` |
| `grbi` | `git rebase --interactive` |
| `grbia` | `git rebase --interactive --autosquash` |
| `grbmi` | `git rebase $(git_main_branch) --interactive` |
| `grbmia` | `git rebase $(git_main_branch) --interactive --autosquash` |
| `grbo` | `git rebase --onto` |
+1
View File
@@ -357,6 +357,7 @@ alias grb='git rebase'
alias grba='git rebase --abort'
alias grbc='git rebase --continue'
alias grbi='git rebase --interactive'
alias grbia='git rebase --interactive --autosquash'
alias grbo='git rebase --onto'
alias grbs='git rebase --skip'
alias grbd='git rebase $(git_develop_branch)'
+14 -61
View File
@@ -202,54 +202,6 @@ if is_tty; then
RESET=$(printf '\033[0m')
fi
# Logo lines, split by `|` into one segment per rainbow color
BANNER=(
' |__ | | | | |__ '
' ____ |/ /_ | ____ ___ |__ __ | ____ |_____|/ /_ '
' / __ \|/ __ \ | / __ `__ \|/ / / / | /_ / |/ ___/| __ \ '
'/ /_/ /| / / / | / / / / / /| /_/ / | / /_|(__ )| / / / '
'\____/|_/ /_/ | /_/ /_/ /_/|\__, / | /___/|____/|_/ /_/ '
' | | | /____/ | | | '
)
# Print the first $1 columns of the logo
print_banner_frame() {
local line i
local -i remaining
local -a segments
for line in $BANNER; do
remaining=$1
segments=("${(@s:|:)line}")
for (( i = 1; i <= $#segments && remaining > 0; i++ )); do
printf '%s%s' "${RAINBOW[i]}" "${segments[i][1,remaining]}"
(( remaining -= ${#segments[i]} ))
done
printf '%s\n' "$RESET"
done
}
# Draw the logo left to right on a terminal, all at once otherwise
print_banner() {
local -i width=${#${BANNER[2]//|}} step=4 col
if ! is_tty || ! zmodload zsh/zselect 2>/dev/null; then
print_banner_frame $width
return
fi
setopt localtraps
trap '_omz_upgrade_cleanup; printf "\033[?25h"; exit 130' INT
printf '\033[?25l'
for (( col = step; ; col += step )); do
(( col > width )) && col=width
print_banner_frame $col
(( col == width )) && break
printf '\033[%dA' $#BANNER
zselect -t 2
done
printf '\033[?25h'
}
# Update upstream remote to ohmyzsh org
git remote -v | while read remote url extra; do
case "$url" in
@@ -319,17 +271,6 @@ git checkout -q "$branch" -- || exit 1
# branch commit before update (used in changelog)
last_commit=$(git rev-parse "$branch")
_omz_upgrade_cleanup() {
# go back to HEAD previous to update
git checkout -q "$last_head" --
# Unset git-config values set just for the upgrade
case "$resetAutoStash" in
"") git config --unset rebase.autoStash ;;
*) git config rebase.autoStash "$resetAutoStash" ;;
esac
}
# Update Oh My Zsh
if [[ $verbose_mode != silent ]]; then
printf "${BLUE}%s${RESET}\n" "Updating Oh My Zsh"
@@ -362,7 +303,12 @@ if perform_update; then
fi
if [[ $verbose_mode == default ]]; then
print_banner
printf '%s %s__ %s %s %s %s %s__ %s\n' $RAINBOW $RESET
printf '%s ____ %s/ /_ %s ____ ___ %s__ __ %s ____ %s_____%s/ /_ %s\n' $RAINBOW $RESET
printf '%s / __ \\%s/ __ \\ %s / __ `__ \\%s/ / / / %s /_ / %s/ ___/%s __ \\ %s\n' $RAINBOW $RESET
printf '%s/ /_/ /%s / / / %s / / / / / /%s /_/ / %s / /_%s(__ )%s / / / %s\n' $RAINBOW $RESET
printf '%s\\____/%s_/ /_/ %s /_/ /_/ /_/%s\\__, / %s /___/%s____/%s_/ /_/ %s\n' $RAINBOW $RESET
printf '%s %s %s %s /____/ %s %s %s %s\n' $RAINBOW $RESET
printf '\n'
printf "${BLUE}%s${RESET}\n\n" "$message"
printf "${BLUE}${BOLD}%s %s %s %s${RESET}\n" \
@@ -385,7 +331,14 @@ else
printf "${RED}%s${RESET}\n" 'There was an error updating. Try again later?'
fi
_omz_upgrade_cleanup
# go back to HEAD previous to update
git checkout -q "$last_head" --
# Unset git-config values set just for the upgrade
case "$resetAutoStash" in
"") git config --unset rebase.autoStash ;;
*) git config rebase.autoStash "$resetAutoStash" ;;
esac
# Exit with `1` if the update failed
exit $ret