Re: [PATCH v4 13/13] tag: add --column
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:52:56
Nguyễn Thái Ngọc Duy [off-list ref] writes:
quoted hunk
@@ -421,6 +428,8 @@ int cmd_tag(int argc, const char **argv, const char *prefix) }; git_config(git_tag_config, NULL); + if (!colopts) + colopts = git_colopts; memset(&opt, 0, sizeof(opt));@@ -441,9 +450,19 @@ int cmd_tag(int argc, const char **argv, const char *prefix) if (list + delete + verify > 1) usage_with_options(git_tag_usage, options); - if (list) - return list_tags(argv, lines == -1 ? 0 : lines, - with_commit); + if (list) { + int ret; + if (lines == -1) { + struct column_options copts; + memset(&copts, 0, sizeof(copts)); + copts.padding = 2; + run_column_filter(colopts, &copts); + } + ret = list_tags(argv, lines == -1 ? 0 : lines, with_commit); + if (lines == -1) + stop_column_filter(); + return ret; + } if (lines != -1) die(_("-n option is only allowed with -l.")); if (with_commit)
The patch is surprisingly small, which is a good sign. The same comment to the silent suppression "branch -v --column" applies here to "tag -n".