From: Junio C Hamano Date: Mon, 5 Oct 2015 19:30:02 +0000 (-0700) Subject: Merge branch 'kn/for-each-tag-branch' X-Git-Tag: v2.7.0-rc0~150 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/9958dd8685a0a8b3d6ecdd07e35d8ecb22b304a7?hp=--cc Merge branch 'kn/for-each-tag-branch' Some features from "git tag -l" and "git branch -l" have been made available to "git for-each-ref" so that eventually the unified implementation can be shared across all three, in a follow-up series or two. * kn/for-each-tag-branch: for-each-ref: add '--contains' option ref-filter: implement '--contains' option parse-options.h: add macros for '--contains' option parse-option: rename parse_opt_with_commit() for-each-ref: add '--merged' and '--no-merged' options ref-filter: implement '--merged' and '--no-merged' options ref-filter: add parse_opt_merge_filter() for-each-ref: add '--points-at' option ref-filter: implement '--points-at' option tag: libify parse_opt_points_at() t6302: for-each-ref tests for ref-filter APIs --- 9958dd8685a0a8b3d6ecdd07e35d8ecb22b304a7 diff --cc parse-options-cb.c index 5ab6ed6b08,632f10f202..239898d946 --- a/parse-options-cb.c +++ b/parse-options-cb.c @@@ -4,7 -4,7 +4,8 @@@ #include "commit.h" #include "color.h" #include "string-list.h" +#include "argv-array.h" + #include "sha1-array.h" /*----- some often used options -----*/ diff --cc parse-options.h index 3f1cc3aee0,6db7cb31cc..e8b55ea87a --- a/parse-options.h +++ b/parse-options.h @@@ -247,9 -243,12 +248,16 @@@ extern int parse_opt_passthru_argv(cons OPT_COLOR_FLAG(0, "color", (var), (h)) #define OPT_COLUMN(s, l, v, h) \ { OPTION_CALLBACK, (s), (l), (v), N_("style"), (h), PARSE_OPT_OPTARG, parseopt_column_callback } +#define OPT_PASSTHRU(s, l, v, a, h, f) \ + { OPTION_CALLBACK, (s), (l), (v), (a), (h), (f), parse_opt_passthru } +#define OPT_PASSTHRU_ARGV(s, l, v, a, h, f) \ + { OPTION_CALLBACK, (s), (l), (v), (a), (h), (f), parse_opt_passthru_argv } + #define _OPT_CONTAINS_OR_WITH(name, variable, help, flag) \ + { OPTION_CALLBACK, 0, name, (variable), N_("commit"), (help), \ + PARSE_OPT_LASTARG_DEFAULT | flag, \ + parse_opt_commits, (intptr_t) "HEAD" \ + } + #define OPT_CONTAINS(v, h) _OPT_CONTAINS_OR_WITH("contains", v, h, 0) + #define OPT_WITH(v, h) _OPT_CONTAINS_OR_WITH("with", v, h, PARSE_OPT_HIDDEN) #endif