git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] t1300: Add tests for git-config --bool --get
@ 2007-05-20 22:12 Frank Lichtenheld
  2007-05-20 22:12 ` [PATCH] git-config: Correct asciidoc documentation for --int/--bool Frank Lichtenheld
  0 siblings, 1 reply; 2+ messages in thread
From: Frank Lichtenheld @ 2007-05-20 22:12 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano, Frank Lichtenheld

Noticed that there were only tests for --int, but not
for --bool. Add some.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
---
 t/t1300-repo-config.sh |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index a1d777c..3f3fd2d 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -436,6 +436,40 @@ test_expect_success numbers '
 	test z1048576 = "z$m"
 '
 
+cat > expect << EOF
+true
+false
+true
+false
+true
+false
+true
+false
+EOF
+
+test_expect_success bool '
+
+	git-config bool.true1 01 &&
+	git-config bool.true2 -1 &&
+	git-config bool.true3 YeS &&
+	git-config bool.true4 true &&
+	git-config bool.false1 000 &&
+	git-config bool.false2 "" &&
+	git-config bool.false3 nO &&
+	git-config bool.false4 FALSE &&
+	rm -f result &&
+	for i in 1 2 3 4
+	do
+	    git-config --bool --get bool.true$i >>result
+	    git-config --bool --get bool.false$i >>result
+        done &&
+	cmp expect result'
+
+test_expect_failure 'invalid bool' '
+
+	git-config bool.nobool foobar &&
+	git-config --bool --get bool.nobool'
+
 rm .git/config
 
 git-config quote.leading " test"
-- 
1.5.2-rc3.GIT

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] git-config: Correct asciidoc documentation for --int/--bool
  2007-05-20 22:12 [PATCH] t1300: Add tests for git-config --bool --get Frank Lichtenheld
@ 2007-05-20 22:12 ` Frank Lichtenheld
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Lichtenheld @ 2007-05-20 22:12 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano, Frank Lichtenheld

The asciidoc documentation seemed to indicate that type specifiers
are honoured on writing operations which they aren't. Make this
more clear.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
---
 Documentation/git-config.txt |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index 280ef20..827a499 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -9,15 +9,15 @@ git-config - Get and set repository or global options
 SYNOPSIS
 --------
 [verse]
-'git-config' [--system | --global] [type] name [value [value_regex]]
-'git-config' [--system | --global] [type] --add name value
-'git-config' [--system | --global] [type] --replace-all name [value [value_regex]]
+'git-config' [--system | --global] name [value [value_regex]]
+'git-config' [--system | --global] --add name value
+'git-config' [--system | --global] --replace-all name [value [value_regex]]
 'git-config' [--system | --global] [type] --get name [value_regex]
 'git-config' [--system | --global] [type] --get-all name [value_regex]
-'git-config' [--system | --global] [type] --unset name [value_regex]
-'git-config' [--system | --global] [type] --unset-all name [value_regex]
-'git-config' [--system | --global] [type] --rename-section old_name new_name
-'git-config' [--system | --global] [type] --remove-section name
+'git-config' [--system | --global] --unset name [value_regex]
+'git-config' [--system | --global] --unset-all name [value_regex]
+'git-config' [--system | --global] --rename-section old_name new_name
+'git-config' [--system | --global] --remove-section name
 'git-config' [--system | --global] -l | --list
 
 DESCRIPTION
@@ -36,7 +36,8 @@ prepend a single exclamation mark in front (see EXAMPLES).
 The type specifier can be either '--int' or '--bool', which will make
 'git-config' ensure that the variable(s) are of the given type and
 convert the value to the canonical form (simple decimal number for int,
-a "true" or "false" string for bool). If no type specifier is passed,
+a "true" or "false" string for bool).  Type specifiers currently only
+take effect for reading operations.  If no type specifier is passed,
 no checks or transformations are performed on the value.
 
 This command will fail if:
-- 
1.5.2-rc3.GIT

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-05-20 22:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-20 22:12 [PATCH] t1300: Add tests for git-config --bool --get Frank Lichtenheld
2007-05-20 22:12 ` [PATCH] git-config: Correct asciidoc documentation for --int/--bool Frank Lichtenheld

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 NNTP newsgroup(s).