From: Junio C Hamano Date: Mon, 24 Aug 2015 22:30:29 +0000 (-0700) Subject: Merge 'kn/for-each-tag-branch' into kn/for-each-tag X-Git-Tag: v2.7.0-rc0~137^2~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a123b19eec0d5faa8df38b92418fe1834f2fe63b;p=thirdparty%2Fgit.git Merge 'kn/for-each-tag-branch' into kn/for-each-tag * 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 --- a123b19eec0d5faa8df38b92418fe1834f2fe63b 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 6ca8388a53,6db7cb31cc..a2bc34e9d7 --- 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