From facf5b905186576e5969866e0cb1c07f35b1e2ed Mon Sep 17 00:00:00 2001 From: NunzioFornitto Date: Wed, 29 Jul 2026 16:48:03 +0200 Subject: [PATCH] fix(git): fix markdown table syntax and restore alphabetical function ordering --- plugins/git/README.md | 2 +- plugins/git/git.plugin.zsh | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/plugins/git/README.md b/plugins/git/README.md index 935ffbb4e..704ddf404 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -254,7 +254,7 @@ receive further support. | `git_current_user_name` | Returns the `user.name` config value (Lives in `lib/git.zsh`) | | `git_develop_branch` | Returns the name of the “development” branch: `dev`, `devel`, `development` if they exist, `develop` otherwise | | `git_main_branch` | Returns the name of the main branch: `main` if it exists, `master` otherwise -| `gbcopy` | Copy current branch name to clipboard | | +| `gbcopy` | Copy current branch name to clipboard | | `grename ` | Renames branch `` to ``, including on the origin remote | | `gbda` | Deletes all merged branches | | `gbds` | Deletes all squash-merged branches (**Note: performance degrades with number of branches**) | diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 9e91beca5..a99ff4e28 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -22,6 +22,16 @@ function git_develop_branch() { echo develop return 1 } +function gbcopy() { + # Check if we are in a Git repository + command git rev-parse --is-inside-work-tree &>/dev/null || return + + local branch + branch="$(git_current_branch)" || return + [[ -n "$branch" ]] || return 1 + + print -rn -- "$branch" | clipcopy +} # Get the default branch name from common branch names or fallback to remote HEAD function git_main_branch() { @@ -48,16 +58,6 @@ function git_main_branch() { echo master return 1 } -function gbcopy() { - # Check if we are in a Git repository - command git rev-parse --is-inside-work-tree &>/dev/null || return - - local branch - branch="$(git_current_branch)" || return - [[ -n "$branch" ]] || return 1 - - print -rn -- "$branch" | clipcopy -} function grename() { if [[ -z "$1" || -z "$2" ]]; then