]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin-tag.c
Rename the "crlf" attribute "text"
[thirdparty/git.git] / builtin-tag.c
index a51a6d1ea21412f151238e48984bc13110fcbc6c..4ef1c4f508b0261e725c360e96f2b8cbed50e9ce 100644 (file)
@@ -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;