git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] tag -d: print sha1 of deleted tag

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Dec 10, 2009, 12:23 UTC
Message-ID
<3b0a7bfa75126e4c13ec15a4357645b2bfd14b5b.1260447713.git.git@drmicha.warpmail.net>
In-Reply-To
<87ljhb87nj.fsf@jondo.cante.net>

Print the sha1 of the deleted tag (in addition to the tag name) so that one can easily recreate a mistakenly deleted tag:

git tag -d tagname Deleted tag 'tagname' DEADBEEF git tag 'tagname' DEADBEEF # for lightweight tags git update-ref refs/tags/'tagname' DEADBEEF # for annotated tags

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Suggested-by: Jari Aalto <jari.aalto@cante.net>
---
 builtin-tag.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-tag.c b/builtin-tag.c
index c479018..39d0ce2 100644
--- a/builtin-tag.c
+++ b/builtin-tag.c
@@ -140,7 +140,7 @@ static int delete_tag(const char *name, const char *ref,
 {
 	if (delete_ref(ref, sha1, 0))
 		return 1;
-	printf("Deleted tag '%s'\n", name);
+	printf("Deleted tag '%s' %s\n", name, sha1_to_hex(sha1));
 	return 0;
 }
 
-- 
1.6.6.rc1.292.gd8fe
Previous: Jari AaltoNext: Björn Steinbrink
Message 2 of 10 in “FEATURE REQUEST: display <commit SHA> in message: git tag -d”
  1. Jari AaltoDec 10, 2009
  2. tag -d: print sha1 of deleted tagMichael J Gruber, Dec 10, 2009
  3. Björn SteinbrinkDec 10, 2009
  4. Michael J GruberDec 10, 2009
  5. Jeff KingDec 10, 2009
  6. Jari AaltoDec 10, 2009
  7. Michael J GruberDec 10, 2009
  8. Jeff KingDec 10, 2009
  9. tag -d: print sha1 of deleted tagMichael J Gruber, Dec 10, 2009
  10. Zoltán FüzesiDec 10, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.