From 6515850a1432199f8f3eef8e9ac711b8a7860ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 28 Dec 2021 19:29:39 +0100 Subject: [PATCH] feat(git-flow): add aliases for current `hotfix` branch --- plugins/git-flow/README.md | 43 +++++++++++++++++----------- plugins/git-flow/git-flow.plugin.zsh | 32 +++++++++++---------- 2 files changed, 43 insertions(+), 32 deletions(-) diff --git a/plugins/git-flow/README.md b/plugins/git-flow/README.md index 9c25dec83..fc8ccf0a0 100644 --- a/plugins/git-flow/README.md +++ b/plugins/git-flow/README.md @@ -10,22 +10,31 @@ plugins=(... git-flow) ## Aliases -| Alias | Command | Description | -|---------|----------------------------|----------------------------------------| -| `gfl` | `git flow` | Git-Flow command | -| `gfli` | `git flow init` | Initialize git-flow repository | -| `gcd` | `git checkout develop` | Check out develop branch | -| `gch` | `git checkout hotfix` | Check out hotfix branch | -| `gcr` | `git checkout release` | Check out release branch | -| `gflf` | `git flow feature` | List existing feature branches | -| `gflh` | `git flow hotfix` | List existing hotfix branches | -| `gflr` | `git flow release` | List existing release branches | -| `gflfs` | `git flow feature start` | Start a new feature: `gflfs ` | -| `gflhs` | `git flow hotfix start` | Start a new hotfix: `gflhs ` | -| `gflrs` | `git flow release start` | Start a new release: `gflrs ` | -| `gflff` | `git flow feature finish` | Finish feature: `gflff ` | -| `gflfp` | `git flow feature publish` | Publish feature: `gflfp ` | -| `gflhf` | `git flow hotfix finish` | Finish hotfix: `gflhf ` | -| `gflrf` | `git flow release finish` | Finish release: `gflrf ` | +| Alias | Command | Description | +| --------- | ----------------------------------------- | ---------------------------------------------- | +| `gcd` | `git checkout develop` | Check out develop branch | +| `gch` | `git checkout hotfix` | Check out hotfix branch | +| `gcr` | `git checkout release` | Check out release branch | +| `gfl` | `git flow` | Git-Flow command | +| `gflf` | `git flow feature` | List existing feature branches | +| `gflff` | `git flow feature finish` | Finish feature: `gflff ` | +| `gflffc` | `gflff ${$(git_current_branch)#feature/}` | Finish current feature | +| `gflfp` | `git flow feature publish` | Publish feature: `gflfp ` | +| `gflfpc` | `gflfp ${$(git_current_branch)#feature/}` | Publish current feature | +| `gflfpll` | `git flow feature pull` | Pull remote feature: `gflfpll ` | +| `gflfs` | `git flow feature start` | Start a new feature: `gflfs ` | +| `gflh` | `git flow hotfix` | List existing hotfix branches | +| `gflhf` | `git flow hotfix finish` | Finish hotfix: `gflhf ` | +| `gflhfc` | `gflhf ${$(git_current_branch)#hotfix/}` | Finish current hotfix | +| `gflhp` | `git flow hotfix publish` | Publish hostfix: `gflhp ` | +| `gflhpc` | `gflhp ${$(git_current_branch)#hotfix/}` | Finish current hotfix | +| `gflhs` | `git flow hotfix start` | Start a new hotfix: `gflhs ` | +| `gfli` | `git flow init` | Initialize git-flow repository | +| `gflr` | `git flow release` | List existing release branches | +| `gflrf` | `git flow release finish` | Finish release: `gflrf ` | +| `gflrfc` | `gflrf ${$(git_current_branch)#release/}` | Finish current release | +| `gflrp` | `git flow release publish` | Publish release: `gflrp ` | +| `gflrpc` | `gflrp ${$(git_current_branch)#release/}` | Publish current release | +| `gflrs` | `git flow release start` | Start a new release: `gflrs ` | [More information about `git-flow` commands](https://github.com/nvie/gitflow/wiki/Command-Line-Arguments). diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh index 13399aaa3..f842de998 100644 --- a/plugins/git-flow/git-flow.plugin.zsh +++ b/plugins/git-flow/git-flow.plugin.zsh @@ -1,26 +1,28 @@ # Aliases -alias gfl='git flow' -alias gfli='git flow init' alias gcd='git checkout $(git config gitflow.branch.develop)' alias gch='git checkout $(git config gitflow.prefix.hotfix)' alias gcr='git checkout $(git config gitflow.prefix.release)' +alias gfl='git flow' alias gflf='git flow feature' -alias gflh='git flow hotfix' -alias gflr='git flow release' -alias gflfs='git flow feature start' -alias gflhs='git flow hotfix start' -alias gflrs='git flow release start' alias gflff='git flow feature finish' +alias gflffc='git flow feature finish ${$(git_current_branch)#feature/}' alias gflfp='git flow feature publish' -alias gflhf='git flow hotfix finish' -alias gflrf='git flow release finish' -alias gflhp='git flow hotfix publish' -alias gflrp='git flow release publish' +alias gflfpc='git flow feature publish ${$(git_current_branch)#feature/}' alias gflfpll='git flow feature pull' -alias gflffc='git flow feature finish $(echo $(current_branch) | cut -c 9-)' -alias gflfpc='git flow feature publish $(echo $(current_branch) | cut -c 9-)' -alias gflrfc='git flow release finish $(echo $(current_branch) | cut -c 9-)' -alias gflrpc='git flow release publish $(echo $(current_branch) | cut -c 9-)' +alias gflfs='git flow feature start' +alias gflh='git flow hotfix' +alias gflhf='git flow hotfix finish' +alias gflhfc='git flow hotfix finish ${$(git_current_branch)#hotfix/}' +alias gflhp='git flow hotfix publish' +alias gflhpc='git flow hotfix publish ${$(git_current_branch)#hotfix/}' +alias gflhs='git flow hotfix start' +alias gfli='git flow init' +alias gflr='git flow release' +alias gflrf='git flow release finish' +alias gflrfc='git flow release finish ${$(git_current_branch)#release/}' +alias gflrp='git flow release publish' +alias gflrpc='git flow release publish ${$(git_current_branch)#release/}' +alias gflrs='git flow release start' # Source completion script # Handle $0 according to the standard: