parse-option: rename parse_opt_with_commit()
authorKarthik Nayak <karthik.188@gmail.com>
Tue, 7 Jul 2015 16:06:14 +0000 (21:36 +0530)
committerJunio C Hamano <gitster@pobox.com>
Mon, 3 Aug 2015 17:25:28 +0000 (10:25 -0700)
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>
builtin/branch.c
builtin/tag.c
parse-options-cb.c
parse-options.h
index e63102e47bdb11010838b7e854b0c2a08d04659c..ae9a0ebc666fa126012d76449f3cbddd3d02f8b3 100644 (file)
@@ -832,13 +832,13 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
                        OPTION_CALLBACK, 0, "contains", &with_commit, N_("commit"),
                        N_("print only branches that contain the commit"),
                        PARSE_OPT_LASTARG_DEFAULT,
-                       parse_opt_with_commit, (intptr_t)"HEAD",
+                       parse_opt_commits, (intptr_t)"HEAD",
                },
                {
                        OPTION_CALLBACK, 0, "with", &with_commit, N_("commit"),
                        N_("print only branches that contain the commit"),
                        PARSE_OPT_HIDDEN | PARSE_OPT_LASTARG_DEFAULT,
-                       parse_opt_with_commit, (intptr_t) "HEAD",
+                       parse_opt_commits, (intptr_t) "HEAD",
                },
                OPT__ABBREV(&abbrev),
 
index 280981f573be997dca71e23cc37042647c56e252..7af45a0a90c11edce2df29e8f7bd7c6334394ef8 100644 (file)
@@ -603,13 +603,13 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
                        OPTION_CALLBACK, 0, "contains", &with_commit, N_("commit"),
                        N_("print only tags that contain the commit"),
                        PARSE_OPT_LASTARG_DEFAULT,
-                       parse_opt_with_commit, (intptr_t)"HEAD",
+                       parse_opt_commits, (intptr_t)"HEAD",
                },
                {
                        OPTION_CALLBACK, 0, "with", &with_commit, N_("commit"),
                        N_("print only tags that contain the commit"),
                        PARSE_OPT_HIDDEN | PARSE_OPT_LASTARG_DEFAULT,
-                       parse_opt_with_commit, (intptr_t)"HEAD",
+                       parse_opt_commits, (intptr_t)"HEAD",
                },
                {
                        OPTION_CALLBACK, 0, "points-at", &points_at, N_("object"),
index de75411086c8613e35471e7b17ba9b7edbec0db4..632f10f2026661522a022b13a2ebb0c920983f51 100644 (file)
@@ -77,7 +77,7 @@ int parse_opt_verbosity_cb(const struct option *opt, const char *arg,
        return 0;
 }
 
-int parse_opt_with_commit(const struct option *opt, const char *arg, int unset)
+int parse_opt_commits(const struct option *opt, const char *arg, int unset)
 {
        unsigned char sha1[20];
        struct commit *commit;
index 36c71fedf14ed04b2a7d6879967f13fab1c5a639..2ffd85712712418e2097b95d7e7538bfd21e2521 100644 (file)
@@ -221,7 +221,7 @@ extern int parse_opt_expiry_date_cb(const struct option *, const char *, int);
 extern int parse_opt_color_flag_cb(const struct option *, const char *, int);
 extern int parse_opt_verbosity_cb(const struct option *, const char *, int);
 extern int parse_opt_object_name(const struct option *, const char *, int);
-extern int parse_opt_with_commit(const struct option *, const char *, int);
+extern int parse_opt_commits(const struct option *, const char *, int);
 extern int parse_opt_tertiary(const struct option *, const char *, int);
 extern int parse_opt_string_list(const struct option *, const char *, int);
 extern int parse_opt_noop_cb(const struct option *, const char *, int);