parse-option: rename parse_opt_with_commit()

Rename parse_opt_with_commit() to parse_opt_commits() to show that it can be used to obtain a list of commits and is not constricted to usage of '--contains' option. Mentored-by: Christian Couder <christian.couder@gmail.com> Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Karthik Nayak committed Jul 7, 2015 at 21:36 UTC 9d306b5a6077f026291df3c4a5968eaf95a92417
4 files changed +6 -6
builtin/branch.c
+2 -2
@@ -832,13 +832,13 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
832 OPTION_CALLBACK, 0, "contains", &with_commit, N_("commit"),
833 N_("print only branches that contain the commit"),
834 PARSE_OPT_LASTARG_DEFAULT,
835 - parse_opt_with_commit, (intptr_t)"HEAD",
835 + parse_opt_commits, (intptr_t)"HEAD",
836 },
837 {
838 OPTION_CALLBACK, 0, "with", &with_commit, N_("commit"),
839 N_("print only branches that contain the commit"),
840 PARSE_OPT_HIDDEN | PARSE_OPT_LASTARG_DEFAULT,
841 - parse_opt_with_commit, (intptr_t) "HEAD",
841 + parse_opt_commits, (intptr_t) "HEAD",
842 },
843 OPT__ABBREV(&abbrev),
844
builtin/tag.c
+2 -2
@@ -603,13 +603,13 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
603 OPTION_CALLBACK, 0, "contains", &with_commit, N_("commit"),
604 N_("print only tags that contain the commit"),
605 PARSE_OPT_LASTARG_DEFAULT,
606 - parse_opt_with_commit, (intptr_t)"HEAD",
606 + parse_opt_commits, (intptr_t)"HEAD",
607 },
608 {
609 OPTION_CALLBACK, 0, "with", &with_commit, N_("commit"),
610 N_("print only tags that contain the commit"),
611 PARSE_OPT_HIDDEN | PARSE_OPT_LASTARG_DEFAULT,
612 - parse_opt_with_commit, (intptr_t)"HEAD",
612 + parse_opt_commits, (intptr_t)"HEAD",
613 },
614 {
615 OPTION_CALLBACK, 0, "points-at", &points_at, N_("object"),
parse-options-cb.c
+1 -1
@@ -77,7 +77,7 @@ int parse_opt_verbosity_cb(const struct option *opt, const char *arg,
77 return 0;
78 }
79
80 -int parse_opt_with_commit(const struct option *opt, const char *arg, int unset)
80 +int parse_opt_commits(const struct option *opt, const char *arg, int unset)
81 {
82 unsigned char sha1[20];
83 struct commit *commit;
parse-options.h
+1 -1
@@ -221,7 +221,7 @@ extern int parse_opt_expiry_date_cb(const struct option *, const char *, int);
221 extern int parse_opt_color_flag_cb(const struct option *, const char *, int);
222 extern int parse_opt_verbosity_cb(const struct option *, const char *, int);
223 extern int parse_opt_object_name(const struct option *, const char *, int);
224 -extern int parse_opt_with_commit(const struct option *, const char *, int);
224 +extern int parse_opt_commits(const struct option *, const char *, int);
225 extern int parse_opt_tertiary(const struct option *, const char *, int);
226 extern int parse_opt_string_list(const struct option *, const char *, int);
227 extern int parse_opt_noop_cb(const struct option *, const char *, int);