From 7d3a702b152cf830aa96abf7032061aa41d93193 Mon Sep 17 00:00:00 2001 From: Joran Van Belle Date: Wed, 17 Jul 2024 14:37:33 +0200 Subject: [PATCH] feat(git): add support for tag creation --- plugins/git/README.md | 3 ++- plugins/git/git.plugin.zsh | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/git/README.md b/plugins/git/README.md index c10f1d88e..21bdc3202 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -11,7 +11,7 @@ plugins=(... git) ## Aliases | Alias | Command | -| :--------------------- | :------------------------------------------------------------------------------------------------------------------------------ | +|:-----------------------|:--------------------------------------------------------------------------------------------------------------------------------| | `grt` | `cd "$(git rev-parse --show-toplevel \|\| echo .)"` | | `ggpnp` | `ggl && ggp` | | `ggpur` | `ggu` | @@ -205,6 +205,7 @@ plugins=(... git) | `gta` | `git tag --annotate` | | `gts` | `git tag -s` | | `gtv` | `git tag \| sort -V` | +| `gtc` | `git tag -a -m ` | | `gignore` | `git update-index --assume-unchanged` | | `gunignore` | `git update-index --no-assume-unchanged` | | `gwch` | `git whatchanged -p --abbrev-commit --pretty=medium` | diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 99fcc4d07..58c0d5f22 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -327,6 +327,13 @@ function ggp() { } compdef _git ggp=git-checkout +function git_tag_add() { + local tagName=$1 + local message=${2:-$tagName} + + git tag -a "$tagName" -m "$message" +} + alias gpu='git push upstream' alias grb='git rebase' alias grba='git rebase --abort' @@ -391,6 +398,7 @@ alias gswm='git switch $(git_main_branch)' alias gta='git tag --annotate' alias gts='git tag --sign' alias gtv='git tag | sort -V' +alias gtc='git_tag_add' alias gignore='git update-index --assume-unchanged' alias gunignore='git update-index --no-assume-unchanged' alias gwch='git whatchanged -p --abbrev-commit --pretty=medium'