refactor(git)!: remove old deprecated aliases (#13149)

BREAKING CHANGE: the following deprecated aliases have been removed:
gup, gupv, gupa, gupav, gupom, gupom. The following aliases have been
deprecated: ggpull, ggpur, ggpush. `current_branch` has also been
deprecated, in favor of `git_current_branch`.
This commit is contained in:
Arvin Verain
2025-12-18 01:35:46 +08:00
committed by GitHub
parent b5c449e1eb
commit d4a62a2715
2 changed files with 29 additions and 55 deletions

View File

@@ -8,14 +8,6 @@ git_version="${${(As: :)$(git version 2>/dev/null)}[3]}"
# (order should follow README)
#
# The name of the current branch
# Back-compatibility wrapper for when this function was defined here in
# the plugin, before being pulled in to core lib/git.zsh as git_current_branch()
# to fix the core -> git plugin dependency.
function current_branch() {
git_current_branch
}
# Check for develop and similarly named branches
function git_develop_branch() {
command git rev-parse --git-dir &>/dev/null || return
@@ -110,7 +102,6 @@ function ggpnp() {
}
compdef _git ggpnp=git-checkout
alias ggpur='ggu'
alias g='git'
alias ga='git add'
alias gaa='git add --all'
@@ -290,7 +281,6 @@ alias gprom='git pull --rebase origin $(git_main_branch)'
alias gpromi='git pull --rebase=interactive origin $(git_main_branch)'
alias gprum='git pull --rebase upstream $(git_main_branch)'
alias gprumi='git pull --rebase=interactive upstream $(git_main_branch)'
alias ggpull='git pull origin "$(git_current_branch)"'
function ggl() {
if [[ $# != 0 ]] && [[ $# != 1 ]]; then
@@ -334,7 +324,6 @@ is-at-least 2.30 "$git_version" \
alias gpv='git push --verbose'
alias gpoat='git push origin --all && git push origin --tags'
alias gpod='git push origin --delete'
alias ggpush='git push origin "$(git_current_branch)"'
function ggp() {
if [[ $# != 0 ]] && [[ $# != 1 ]]; then
@@ -427,19 +416,16 @@ alias gke='\gitk --all $(git log --walk-reflogs --pretty=%h) &!'
unset git_version
# Logic for adding warnings on deprecated aliases
local old_alias new_alias
for old_alias new_alias (
# TODO(2023-10-19): remove deprecated `git pull --rebase` aliases
gup gpr
gupv gprv
gupa gpra
gupav gprav
gupom gprom
gupomi gpromi
# Logic for adding warnings on deprecated aliases or functions
local old_name new_name
for old_name new_name (
current_branch git_current_branch
ggpull ggl
ggpur ggu
ggpush ggp
); do
aliases[$old_alias]="
print -Pu2 \"%F{yellow}[oh-my-zsh] '%F{red}${old_alias}%F{yellow}' is a deprecated alias, using '%F{green}${new_alias}%F{yellow}' instead.%f\"
$new_alias"
aliases[$old_name]="
print -Pu2 \"%F{yellow}[oh-my-zsh] '%F{red}${old_name}%F{yellow}' is deprecated, using '%F{green}${new_name}%F{yellow}' instead.%f\"
$new_name"
done
unset old_alias new_alias
unset old_name new_name