From de517fa921db66b9b2ad42d87a45c96baa54feb7 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Mon, 3 Jul 2023 14:18:10 +0200 Subject: [PATCH] config/git: migrate tag helpers --- .config/shell/git | 12 ------------ .local/bin/scripts/git-retag | 3 +++ .local/bin/scripts/git-rmtag | 6 ++++++ 3 files changed, 9 insertions(+), 12 deletions(-) create mode 100755 .local/bin/scripts/git-retag create mode 100755 .local/bin/scripts/git-rmtag diff --git a/.config/shell/git b/.config/shell/git index 8b87c21..79575c6 100644 --- a/.config/shell/git +++ b/.config/shell/git @@ -55,18 +55,6 @@ git() { command git "$@" } -# BRANCHES -# Remove list of tags local & remote -gitrmtag() { - declare -a refs - local index=1 - for tag in $@; do refs[index++]=":refs/tags/$tag"; done - git push origin "${refs[@]}" && git tag -d "$@" -} -# Rename a tag -gitretag() { - git push origin refs/tags/${1}:refs/tags/${2} :refs/tags/$1 && git tag -d $1 -} # Testing gittestcommit() { touch file$((++i)) && git add 'file*' && git commit -m "Create file$i"; } diff --git a/.local/bin/scripts/git-retag b/.local/bin/scripts/git-retag new file mode 100755 index 0000000..63fad9a --- /dev/null +++ b/.local/bin/scripts/git-retag @@ -0,0 +1,3 @@ +#!/bin/sh -e +# Rename a tag +git push origin refs/tags/${1}:refs/tags/${2} :refs/tags/$1 && git tag -d $1 diff --git a/.local/bin/scripts/git-rmtag b/.local/bin/scripts/git-rmtag new file mode 100755 index 0000000..2ad2781 --- /dev/null +++ b/.local/bin/scripts/git-rmtag @@ -0,0 +1,6 @@ +#!/bin/bash -e +# Remove list of tags local & remote +declare -a refs +index=1 +for tag in $@; do refs[index++]=":refs/tags/$tag"; done +git push origin "${refs[@]}" && git tag -d "$@"