Skip to content

Commit 9d306b5

Browse files
KarthikNayakgitster
authored andcommitted
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 <[email protected]> Mentored-by: Matthieu Moy <[email protected]> Signed-off-by: Karthik Nayak <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7c32834 commit 9d306b5

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

builtin/branch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,13 +832,13 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
832832
OPTION_CALLBACK, 0, "contains", &with_commit, N_("commit"),
833833
N_("print only branches that contain the commit"),
834834
PARSE_OPT_LASTARG_DEFAULT,
835-
parse_opt_with_commit, (intptr_t)"HEAD",
835+
parse_opt_commits, (intptr_t)"HEAD",
836836
},
837837
{
838838
OPTION_CALLBACK, 0, "with", &with_commit, N_("commit"),
839839
N_("print only branches that contain the commit"),
840840
PARSE_OPT_HIDDEN | PARSE_OPT_LASTARG_DEFAULT,
841-
parse_opt_with_commit, (intptr_t) "HEAD",
841+
parse_opt_commits, (intptr_t) "HEAD",
842842
},
843843
OPT__ABBREV(&abbrev),
844844

builtin/tag.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,13 +603,13 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
603603
OPTION_CALLBACK, 0, "contains", &with_commit, N_("commit"),
604604
N_("print only tags that contain the commit"),
605605
PARSE_OPT_LASTARG_DEFAULT,
606-
parse_opt_with_commit, (intptr_t)"HEAD",
606+
parse_opt_commits, (intptr_t)"HEAD",
607607
},
608608
{
609609
OPTION_CALLBACK, 0, "with", &with_commit, N_("commit"),
610610
N_("print only tags that contain the commit"),
611611
PARSE_OPT_HIDDEN | PARSE_OPT_LASTARG_DEFAULT,
612-
parse_opt_with_commit, (intptr_t)"HEAD",
612+
parse_opt_commits, (intptr_t)"HEAD",
613613
},
614614
{
615615
OPTION_CALLBACK, 0, "points-at", &points_at, N_("object"),

parse-options-cb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ int parse_opt_verbosity_cb(const struct option *opt, const char *arg,
7777
return 0;
7878
}
7979

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)
8181
{
8282
unsigned char sha1[20];
8383
struct commit *commit;

parse-options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ extern int parse_opt_expiry_date_cb(const struct option *, const char *, int);
221221
extern int parse_opt_color_flag_cb(const struct option *, const char *, int);
222222
extern int parse_opt_verbosity_cb(const struct option *, const char *, int);
223223
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);
225225
extern int parse_opt_tertiary(const struct option *, const char *, int);
226226
extern int parse_opt_string_list(const struct option *, const char *, int);
227227
extern int parse_opt_noop_cb(const struct option *, const char *, int);

0 commit comments

Comments
 (0)