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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxxx>
Suggested-by: Jari Aalto <jari.aalto@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]