From: Junio C Hamano Date: Thu, 08 Nov 2007 00:54:42 GMT Subject: Re: [PATCH] hooks--update: allow deleting a tag through git push : Message-ID: <7v640d8skt.fsf@gitster.siamese.dyndns.org> In-Reply-To: <20071107103450.29849.qmail@c27a4ce40673ff.315fe32.mid.smarden.org> Gerrit Pape writes: > The update hook interpretes deleting a tag, no matter if annotated or not, > through git push : 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 > --- > 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