From mboxrd@z Thu Jan 1 00:00:00 1970 From: Karthik Nayak Subject: [PATCH v8 08/11] parse-option: rename parse_opt_with_commit() Date: Tue, 7 Jul 2015 21:36:14 +0530 Message-ID: <1436285177-12279-8-git-send-email-karthik.188@gmail.com> References: <1436285177-12279-1-git-send-email-karthik.188@gmail.com> Cc: christian.couder@gmail.com, Matthieu.Moy@grenoble-inp.fr, Karthik Nayak To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Tue Jul 07 18:07:56 2015 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZCVPX-0001oz-71 for gcvg-git-2@plane.gmane.org; Tue, 07 Jul 2015 18:07:55 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758030AbbGGQHr (ORCPT ); Tue, 7 Jul 2015 12:07:47 -0400 Received: from mail-pd0-f181.google.com ([209.85.192.181]:32986 "EHLO mail-pd0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751982AbbGGQHk (ORCPT ); Tue, 7 Jul 2015 12:07:40 -0400 Received: by pdbdz6 with SMTP id dz6so33487576pdb.0 for ; Tue, 07 Jul 2015 09:07:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ASngZ2q9zZuS2E/CpPCr/FvrNAjVbrmansZuDAeEH7I=; b=GBTMuiJSIC2fU9XuCekpHY5n3L47RIR9pJz3aF2/W/1D4JX0IJfY41g1gKgOi8c2hx x5bjfRtTUz9xqbiao7/gDfStXOItJrHqt0NVMstHfQ6Hs28qev4+Jqk12OBthHx7yHhR GRMRLQBsIyrEahLlDMoFTZgVk3joCCzvZ5Ld4mLggX/QNsjLeSN/1sRCTgH3CkopD0iM z1j7jX2haKlMrfjYkxJV6eWTuCnQm8CG1B2R5UxxpqiIeFgIL8ZReyz1d3t/Sp6mqc9v TqzDttdGXXq5j41CJ0Q3UZCh5/BEea9DaJy66zyU1MG2rpxquxImfW2xqoJrkpCo5u5J eokg== X-Received: by 10.66.120.194 with SMTP id le2mr9010839pab.1.1436285259728; Tue, 07 Jul 2015 09:07:39 -0700 (PDT) Received: from ashley.localdomain ([106.51.130.23]) by mx.google.com with ESMTPSA id nt6sm22295515pbc.18.2015.07.07.09.07.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Jul 2015 09:07:38 -0700 (PDT) X-Mailer: git-send-email 2.4.5 In-Reply-To: <1436285177-12279-1-git-send-email-karthik.188@gmail.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: 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 Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c | 4 ++-- builtin/tag.c | 4 ++-- parse-options-cb.c | 2 +- parse-options.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/builtin/branch.c b/builtin/branch.c index e63102e..ae9a0eb 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -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), diff --git a/builtin/tag.c b/builtin/tag.c index 280981f..7af45a0 100644 --- a/builtin/tag.c +++ b/builtin/tag.c @@ -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"), diff --git a/parse-options-cb.c b/parse-options-cb.c index de75411..632f10f 100644 --- a/parse-options-cb.c +++ b/parse-options-cb.c @@ -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; diff --git a/parse-options.h b/parse-options.h index 1478818..583690c 100644 --- a/parse-options.h +++ b/parse-options.h @@ -224,7 +224,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); -- 2.4.5