]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/tag.c
Merge branch 'en/fetch-negotiation-default-fix'
[thirdparty/git.git] / builtin / tag.c
index 41863c5ab7771a2495fe5845c884d99e83aa1537..134b3f1edf06246aed1eed1e5890a27fff22a3bf 100644 (file)
@@ -483,6 +483,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
                OPT_END()
        };
        int ret = 0;
+       const char *only_in_list = NULL;
 
        setup_ref_filter_porcelain_msg();
 
@@ -522,7 +523,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
        finalize_colopts(&colopts, -1);
        if (cmdmode == 'l' && filter.lines != -1) {
                if (explicitly_enable_column(colopts))
-                       die(_("--column and -n are incompatible"));
+                       die(_("options '%s' and '%s' cannot be used together"), "--column", "-n");
                colopts = 0;
        }
        sorting = ref_sorting_options(&sorting_options);
@@ -542,15 +543,19 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
                goto cleanup;
        }
        if (filter.lines != -1)
-               die(_("-n option is only allowed in list mode"));
-       if (filter.with_commit)
-               die(_("--contains option is only allowed in list mode"));
-       if (filter.no_commit)
-               die(_("--no-contains option is only allowed in list mode"));
-       if (filter.points_at.nr)
-               die(_("--points-at option is only allowed in list mode"));
-       if (filter.reachable_from || filter.unreachable_from)
-               die(_("--merged and --no-merged options are only allowed in list mode"));
+               only_in_list = "-n";
+       else if (filter.with_commit)
+               only_in_list = "--contains";
+       else if (filter.no_commit)
+               only_in_list = "--no-contains";
+       else if (filter.points_at.nr)
+               only_in_list = "--points-at";
+       else if (filter.reachable_from)
+               only_in_list = "--merged";
+       else if (filter.unreachable_from)
+               only_in_list = "--no-merged";
+       if (only_in_list)
+               die(_("the '%s' option is only allowed in list mode"), only_in_list);
        if (cmdmode == 'd') {
                ret = delete_tags(argv);
                goto cleanup;
@@ -564,7 +569,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 
        if (msg.given || msgfile) {
                if (msg.given && msgfile)
-                       die(_("only one -F or -m option is allowed."));
+                       die(_("options '%s' and '%s' cannot be used together"), "-F", "-m");
                if (msg.given)
                        strbuf_addbuf(&buf, &(msg.buf));
                else {