6515850a1432199f8f3eef8e9ac711b8a7860ae5

Author
Marc Cornellà <hello@mcornella.com>
Committer
Marc Cornellà <hello@mcornella.com>
Date

Message

feat(git-flow): add aliases for current `hotfix` branch

Diff

 1diff --git a/plugins/git-flow/README.md b/plugins/git-flow/README.md
 2index 9c25dec83c78602e71892e9839f3c80a77e9faf9..fc8ccf0a09237bd327c6b56fb9e81fdd91497903 100644
 3--- a/plugins/git-flow/README.md
 4+++ b/plugins/git-flow/README.md
 5@@ -10,22 +10,31 @@ plugins=(... git-flow)
 6 
 7 ## Aliases
 8 
 9-| Alias   | Command                    | Description                            |
10-|---------|----------------------------|----------------------------------------|
11-| `gfl`   | `git flow`                 | Git-Flow command                       |
12-| `gfli`  | `git flow init`            | Initialize git-flow repository         |
13-| `gcd`   | `git checkout develop`     | Check out develop branch               |
14-| `gch`   | `git checkout hotfix`      | Check out hotfix branch                |
15-| `gcr`   | `git checkout release`     | Check out release branch               |
16-| `gflf`  | `git flow feature`         | List existing feature branches         |
17-| `gflh`  | `git flow hotfix`          | List existing hotfix branches          |
18-| `gflr`  | `git flow release`         | List existing release branches         |
19-| `gflfs` | `git flow feature start`   | Start a new feature: `gflfs <name>`    |
20-| `gflhs` | `git flow hotfix start`    | Start a new hotfix: `gflhs <version>`  |
21-| `gflrs` | `git flow release start`   | Start a new release: `gflrs <version>` |
22-| `gflff` | `git flow feature finish`  | Finish feature: `gflff <name>`         |
23-| `gflfp` | `git flow feature publish` | Publish feature: `gflfp <name>`        |
24-| `gflhf` | `git flow hotfix finish`   | Finish hotfix: `gflhf <version>`       |
25-| `gflrf` | `git flow release finish`  | Finish release: `gflrf <version>`      |
26+| Alias     | Command                                   | Description                                    |
27+| --------- | ----------------------------------------- | ---------------------------------------------- |
28+| `gcd`     | `git checkout develop`                    | Check out develop branch                       |
29+| `gch`     | `git checkout hotfix`                     | Check out hotfix branch                        |
30+| `gcr`     | `git checkout release`                    | Check out release branch                       |
31+| `gfl`     | `git flow`                                | Git-Flow command                               |
32+| `gflf`    | `git flow feature`                        | List existing feature branches                 |
33+| `gflff`   | `git flow feature finish`                 | Finish feature: `gflff <name>`                 |
34+| `gflffc`  | `gflff ${$(git_current_branch)#feature/}` | Finish current feature                         |
35+| `gflfp`   | `git flow feature publish`                | Publish feature: `gflfp <name>`                |
36+| `gflfpc`  | `gflfp ${$(git_current_branch)#feature/}` | Publish current feature                        |
37+| `gflfpll` | `git flow feature pull`                   | Pull remote feature: `gflfpll <remote> <name>` |
38+| `gflfs`   | `git flow feature start`                  | Start a new feature: `gflfs <name>`            |
39+| `gflh`    | `git flow hotfix`                         | List existing hotfix branches                  |
40+| `gflhf`   | `git flow hotfix finish`                  | Finish hotfix: `gflhf <version>`               |
41+| `gflhfc`  | `gflhf ${$(git_current_branch)#hotfix/}`  | Finish current hotfix                          |
42+| `gflhp`   | `git flow hotfix publish`                 | Publish hostfix: `gflhp <version>`             |
43+| `gflhpc`  | `gflhp ${$(git_current_branch)#hotfix/}`  | Finish current hotfix                          |
44+| `gflhs`   | `git flow hotfix start`                   | Start a new hotfix: `gflhs <version>`          |
45+| `gfli`    | `git flow init`                           | Initialize git-flow repository                 |
46+| `gflr`    | `git flow release`                        | List existing release branches                 |
47+| `gflrf`   | `git flow release finish`                 | Finish release: `gflrf <version>`              |
48+| `gflrfc`  | `gflrf ${$(git_current_branch)#release/}` | Finish current release                         |
49+| `gflrp`   | `git flow release publish`                | Publish release: `gflrp <version>`             |
50+| `gflrpc`  | `gflrp ${$(git_current_branch)#release/}` | Publish current release                        |
51+| `gflrs`   | `git flow release start`                  | Start a new release: `gflrs <version>`         |
52 
53 [More information about `git-flow` commands](https://github.com/nvie/gitflow/wiki/Command-Line-Arguments).
54diff --git a/plugins/git-flow/git-flow.plugin.zsh b/plugins/git-flow/git-flow.plugin.zsh
55index 13399aaa392c74607db270ab97b0131221fb7788..f842de998825940a51b5ff3c9790a7f62056641f 100644
56--- a/plugins/git-flow/git-flow.plugin.zsh
57+++ b/plugins/git-flow/git-flow.plugin.zsh
58@@ -1,26 +1,28 @@
59 # Aliases
60-alias gfl='git flow'
61-alias gfli='git flow init'
62 alias gcd='git checkout $(git config gitflow.branch.develop)'
63 alias gch='git checkout $(git config gitflow.prefix.hotfix)'
64 alias gcr='git checkout $(git config gitflow.prefix.release)'
65+alias gfl='git flow'
66 alias gflf='git flow feature'
67-alias gflh='git flow hotfix'
68-alias gflr='git flow release'
69-alias gflfs='git flow feature start'
70-alias gflhs='git flow hotfix start'
71-alias gflrs='git flow release start'
72 alias gflff='git flow feature finish'
73+alias gflffc='git flow feature finish ${$(git_current_branch)#feature/}'
74 alias gflfp='git flow feature publish'
75+alias gflfpc='git flow feature publish ${$(git_current_branch)#feature/}'
76+alias gflfpll='git flow feature pull'
77+alias gflfs='git flow feature start'
78+alias gflh='git flow hotfix'
79 alias gflhf='git flow hotfix finish'
80-alias gflrf='git flow release finish'
81+alias gflhfc='git flow hotfix finish ${$(git_current_branch)#hotfix/}'
82 alias gflhp='git flow hotfix publish'
83+alias gflhpc='git flow hotfix publish ${$(git_current_branch)#hotfix/}'
84+alias gflhs='git flow hotfix start'
85+alias gfli='git flow init'
86+alias gflr='git flow release'
87+alias gflrf='git flow release finish'
88+alias gflrfc='git flow release finish ${$(git_current_branch)#release/}'
89 alias gflrp='git flow release publish'
90-alias gflfpll='git flow feature pull'
91-alias gflffc='git flow feature finish $(echo $(current_branch) | cut -c 9-)'
92-alias gflfpc='git flow feature publish $(echo $(current_branch) | cut -c 9-)'
93-alias gflrfc='git flow release finish $(echo $(current_branch) | cut -c 9-)'
94-alias gflrpc='git flow release publish $(echo $(current_branch) | cut -c 9-)'
95+alias gflrpc='git flow release publish ${$(git_current_branch)#release/}'
96+alias gflrs='git flow release start'
97 
98 # Source completion script
99 # Handle $0 according to the standard: