git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Gerrit Pape <pape@smarden.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] hooks--update: allow deleting a tag through git push <remote> :<tag>
Date: Wed, 07 Nov 2007 16:54:42 -0800	[thread overview]
Message-ID: <7v640d8skt.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20071107103450.29849.qmail@c27a4ce40673ff.315fe32.mid.smarden.org> (Gerrit Pape's message of "Wed, 7 Nov 2007 10:34:50 +0000")

Gerrit Pape <pape@smarden.org> writes:

> 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

  reply	other threads:[~2007-11-08  0:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-07 10:34 [PATCH] hooks--update: allow deleting a tag through git push <remote> :<tag> Gerrit Pape
2007-11-08  0:54 ` Junio C Hamano [this message]
2007-11-08  9:47   ` [PATCH] hooks--update: decline deleting tags or branches by default, add config options Gerrit Pape

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7v640d8skt.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pape@smarden.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).