Unverified Commit 207d29b7 authored by Zeeshan's avatar Zeeshan Committed by Marc Cornellà

fix(git)!: standardize `git pull --rebase` aliases (#11224)

BREAKING CHANGE: The alias `gup` for `git pull --rebase` and its derivatives are replaced by `gpr` for standardization. This means the previous aliases will no longer be available after a few months. Meanwhile, the original aliases are still working, with a deprecation notice. See https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/git/README.md#deprecated-aliases for the full list of deprecated aliases. Fixes #11104 Closes #11224 Co-authored-by: 's avatarMarc Cornellà <marc@mcornella.com>
parent 9f84ba08
This diff is collapsed.
......@@ -246,12 +246,12 @@ alias gmom='git merge origin/$(git_main_branch)'
alias gmum='git merge upstream/$(git_main_branch)'
alias gmtl='git mergetool --no-prompt'
alias gmtlvim='git mergetool --no-prompt --tool=vimdiff'
alias gl='git pull'
alias gpr='git pull --rebase'
alias gup='git pull --rebase'
alias gupa='git pull --rebase --autostash'
alias gupav='git pull --rebase --autostash --verbose'
alias gupv='git pull --rebase --verbose'
alias gprv='git pull --rebase -v'
alias gpra='git pull --rebase --autostash'
alias gprav='git pull --rebase --autostash -v'
function ggu() {
[[ "$#" != 1 ]] && local b="$(git_current_branch)"
......@@ -259,8 +259,8 @@ function ggu() {
}
compdef _git ggu=git-checkout
alias gupom='git pull --rebase origin $(git_main_branch)'
alias gupomi='git pull --rebase=interactive origin $(git_main_branch)'
alias gprom='git pull --rebase origin $(git_main_branch)'
alias gpromi='git pull --rebase=interactive origin $(git_main_branch)'
alias ggpull='git pull origin "$(git_current_branch)"'
function ggl() {
......@@ -388,3 +388,20 @@ alias gk='\gitk --all --branches &!'
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
); 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"
done
unset old_alias new_alias
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment