X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-tag.c;h=4ef1c4f508b0261e725c360e96f2b8cbed50e9ce;hb=812d2a3d61b1bbb1931aff2ed6d2a17e939f5bf2;hp=a51a6d1ea21412f151238e48984bc13110fcbc6c;hpb=caa7dac163f7f7fc827da6fd4a5aba259a50e1ab;p=git.git diff --git a/builtin-tag.c b/builtin-tag.c index a51a6d1ea..4ef1c4f50 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' (was %s)\n", name, find_unique_abbrev(sha1, DEFAULT_ABBREV)); return 0; } @@ -390,7 +390,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix) OPT_BOOLEAN('s', NULL, &sign, "annotated and GPG-signed tag"), OPT_STRING('u', NULL, &keyid, "key-id", "use another key to sign the tag"), - OPT_BOOLEAN('f', NULL, &force, "replace the tag if exists"), + OPT_BOOLEAN('f', "force", &force, "replace the tag if exists"), OPT_GROUP("Tag listing options"), { @@ -479,6 +479,8 @@ int cmd_tag(int argc, const char **argv, const char *prefix) die("%s: cannot lock the ref", ref); if (write_ref_sha1(lock, object, NULL) < 0) die("%s: cannot update the ref", ref); + if (force && hashcmp(prev, object)) + printf("Updated tag '%s' (was %s)\n", tag, find_unique_abbrev(prev, DEFAULT_ABBREV)); strbuf_release(&buf); return 0;