From 7c32834813bd6aee5ce5b2c4131d9f34249bc9e3 Mon Sep 17 00:00:00 2001 From: Karthik Nayak Date: Tue, 7 Jul 2015 21:36:13 +0530 Subject: for-each-ref: add '--merged' and '--no-merged' options Add the '--merged' and '--no-merged' options provided by 'ref-filter'. The '--merged' option lets the user to only list refs merged into the named commit. The '--no-merged' option lets the user to only list refs not merged into the named commit. Add documentation and tests for the same. Based-on-patch-by: Jeff King Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak Signed-off-by: Junio C Hamano --- builtin/for-each-ref.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'builtin/for-each-ref.c') diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c index ae5419e0de..75218506e4 100644 --- a/builtin/for-each-ref.c +++ b/builtin/for-each-ref.c @@ -8,6 +8,7 @@ static char const * const for_each_ref_usage[] = { N_("git for-each-ref [] []"), N_("git for-each-ref [--points-at ]"), + N_("git for-each-ref [(--merged | --no-merged) []]"), NULL }; @@ -38,6 +39,8 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix) OPT_CALLBACK(0, "points-at", &filter.points_at, N_("object"), N_("print only refs which points at the given object"), parse_opt_object_name), + OPT_MERGED(&filter, N_("print only refs that are merged")), + OPT_NO_MERGED(&filter, N_("print only refs that are not merged")), OPT_END(), }; -- cgit v1.2.3