git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Dave Borowitz <dborowitz@google.com>
To: git@vger.kernel.org, gitster@pobox.com
Cc: Dave Borowitz <dborowitz@google.com>
Subject: [PATCH v2 6/9] config.c: Expose git_parse_maybe_bool
Date: Wed, 19 Aug 2015 11:26:44 -0400	[thread overview]
Message-ID: <1439998007-28719-7-git-send-email-dborowitz@google.com> (raw)
In-Reply-To: <1439998007-28719-1-git-send-email-dborowitz@google.com>

Signed-off-by: Dave Borowitz <dborowitz@google.com>
---
 cache.h  | 1 +
 config.c | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/cache.h b/cache.h
index 6bb7119..95d9594 100644
--- a/cache.h
+++ b/cache.h
@@ -1392,6 +1392,7 @@ extern int git_config_with_options(config_fn_t fn, void *,
 				   int respect_includes);
 extern int git_config_early(config_fn_t fn, void *, const char *repo_config);
 extern int git_parse_ulong(const char *, unsigned long *);
+extern int git_parse_maybe_bool(const char *);
 extern int git_config_int(const char *, const char *);
 extern int64_t git_config_int64(const char *, const char *);
 extern unsigned long git_config_ulong(const char *, const char *);
diff --git a/config.c b/config.c
index 9fd275f..e5d7959 100644
--- a/config.c
+++ b/config.c
@@ -618,7 +618,7 @@ unsigned long git_config_ulong(const char *name, const char *value)
 	return ret;
 }
 
-static int git_config_maybe_bool_text(const char *name, const char *value)
+int git_parse_maybe_bool(const char *value)
 {
 	if (!value)
 		return 1;
@@ -637,7 +637,7 @@ static int git_config_maybe_bool_text(const char *name, const char *value)
 
 int git_config_maybe_bool(const char *name, const char *value)
 {
-	int v = git_config_maybe_bool_text(name, value);
+	int v = git_parse_maybe_bool(value);
 	if (0 <= v)
 		return v;
 	if (git_parse_int(value, &v))
@@ -647,7 +647,7 @@ int git_config_maybe_bool(const char *name, const char *value)
 
 int git_config_bool_or_int(const char *name, const char *value, int *is_bool)
 {
-	int v = git_config_maybe_bool_text(name, value);
+	int v = git_parse_maybe_bool(value);
 	if (0 <= v) {
 		*is_bool = 1;
 		return v;
-- 
2.5.0.276.gf5e568e

  parent reply	other threads:[~2015-08-19 15:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-19 15:26 [PATCH v2 0/9] Flags and config to sign pushes by default Dave Borowitz
2015-08-19 15:26 ` [PATCH v2 1/9] Documentation/git-push.txt: Document when --signed may fail Dave Borowitz
2015-08-19 15:26 ` [PATCH v2 2/9] Documentation/git-send-pack.txt: Flow long synopsis line Dave Borowitz
2015-08-19 19:56   ` Junio C Hamano
2015-08-19 19:59     ` Dave Borowitz
2015-08-19 20:10       ` Junio C Hamano
2015-09-11 16:22         ` Junio C Hamano
2015-08-19 15:26 ` [PATCH v2 3/9] Documentation/git-send-pack.txt: Document --signed Dave Borowitz
2015-08-19 15:26 ` [PATCH v2 4/9] gitremote-helpers.txt: Document pushcert option Dave Borowitz
2015-08-19 15:26 ` [PATCH v2 5/9] transport: Remove git_transport_options.push_cert Dave Borowitz
2015-08-19 15:26 ` Dave Borowitz [this message]
2015-08-19 15:26 ` [PATCH v2 7/9] builtin/send-pack.c: Use option parsing API Dave Borowitz
2015-08-19 18:00   ` Stefan Beller
2015-08-19 19:46     ` Dave Borowitz
2015-08-21 15:06       ` Jeff King
2015-08-19 15:26 ` [PATCH v2 8/9] Support signing pushes iff the server supports it Dave Borowitz
2015-08-19 19:58   ` Junio C Hamano
2015-08-19 20:00     ` Dave Borowitz
2015-08-19 15:26 ` [PATCH v2 9/9] Add a config option push.gpgSign for default signed pushes Dave Borowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1439998007-28719-7-git-send-email-dborowitz@google.com \
    --to=dborowitz@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).