Merge branch 'rj/git-version-gen-do-not-force-abbrev'
[gitweb.git] / builtin / tag.c
index 50e4ae5678c21f348c3ce0e0d0662c9d5f995847..73df728114e81ac87dd1b84604947d739d948fb6 100644 (file)
@@ -335,6 +335,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
        struct ref_filter filter;
        static struct ref_sorting *sorting = NULL, **sorting_tail = &sorting;
        const char *format = NULL;
+       int icase = 0;
        struct option options[] = {
                OPT_CMDMODE('l', "list", &cmdmode, N_("list tag names"), 'l'),
                { OPTION_INTEGER, 'n', NULL, &filter.lines, N_("n"),
@@ -370,6 +371,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
                        N_("print only tags of the object"), 0, parse_opt_object_name
                },
                OPT_STRING(  0 , "format", &format, N_("format"), N_("format to use for the output")),
+               OPT_BOOL('i', "ignore-case", &icase, N_("sorting and filtering are case insensitive")),
                OPT_END()
        };
 
@@ -401,6 +403,8 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
        }
        if (!sorting)
                sorting = ref_default_sorting();
+       sorting->ignore_case = icase;
+       filter.ignore_case = icase;
        if (cmdmode == 'l') {
                int ret;
                if (column_active(colopts)) {