Re: [PATCH] hooks--update: allow deleting a tag through git push <remote> :<tag>
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 8, 2007, 00:54 UTC
- Message-ID
- <7v640d8skt.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20071107103450.29849.qmail@c27a4ce40673ff.315fe32.mid.smarden.org>
Gerrit Pape <pape@smarden.org> writes:
Show 11 quoted lines
> The update hook interpretes deleting a tag, no matter if annotated or not, > through git push <remote> :<tag> as unannotated tag, and declines it by > default: > ... > With this patch deleting a tag is allowed unconditionally, just as > deleting a branch. > > Signed-off-by: Gerrit Pape <pape@smarden.org> > --- > templates/hooks--update | 9 ++++++--- > 1 files changed, 6 insertions(+), 3 deletions(-)
Since you are allowing deletion for anything, wouldn't this be much simpler, I wonder...
---
templates/hooks--update | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/templates/hooks--update b/templates/hooks--update index d8c7626..e12904a 100644 --- a/templates/hooks--update +++ b/templates/hooks--update @@ -41,9 +41,9 @@ if [ -z "$projectdesc" -o "$projectdesc" = "Unnamed repository; edit this file t fi # --- Check types -# if $newrev is 0000...0000, it's a commit to delete a branch +# if $newrev is 0000...0000, it's a commit to delete a ref. if [ "$newrev" = "0000000000000000000000000000000000000000" ]; then - newrev_type=commit + exit 0 ;# allow anything to be deleted else newrev_type=$(git-cat-file -t $newrev) fi