From 118ffe6fc1138c724cbdab629c5f85b6e203a22b Mon Sep 17 00:00:00 2001 From: Arvin Verain Date: Mon, 2 Jun 2025 02:18:46 +0800 Subject: [PATCH] refactor(git)!: Start deprecating `ggpull`/`ggpur`/`ggpush` for their alternative functions --- plugins/git/README.md | 6 +++--- plugins/git/git.plugin.zsh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/git/README.md b/plugins/git/README.md index da3f903f0..050717e82 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -240,13 +240,13 @@ receive further support. | `gcl` | `git config --list` | New alias: `gcf`. | | `gdc` | `git diff --cached` | New alias: `gdca`. | | `gdt` | `git difftool` | No replacement. | -| `ggpull` | `git pull origin $(current_branch)` | New alias: `ggl`. (`ggpull` still exists for now though.) | -| `ggpur` | `git pull --rebase origin $(current_branch)` | New alias: `ggu`. (`ggpur` still exists for now though.) | -| `ggpush` | `git push origin $(current_branch)` | New alias: `ggp`. (`ggpush` still exists for now though.) | | `gk` | `gitk --all --branches` | Now aliased to `gitk --all --branches`. | | `glg` | `git log --stat --max-count=10` | Now aliased to `git log --stat --color`. | | `glgg` | `git log --graph --max-count=10` | Now aliased to `git log --graph --color`. | | `gwc` | `git whatchanged -p --abbrev-commit --pretty = medium` | New alias: `gwch`. | +| `ggpull` | `git pull origin $(git_current_branch)` | New function: `ggl` (`ggpull` is now aliased to this) | +| `ggpur` | `git pull --rebase origin $(git_current_branch)` | New function: `ggu` (`ggpur` is now aliased to this) | +| `ggpush` | `git push origin $(git_current_branch)` | New function: `ggp` (`ggpush` is now aliased to this) | ## Functions diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 63b633af5..271018837 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -110,7 +110,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 +289,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 +332,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 @@ -430,6 +427,9 @@ unset git_version # Logic for adding warnings on deprecated aliases local old_alias new_alias for old_alias new_alias ( + 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\"