author | Petr Baudis <pasky@suse.cz> | |
Sun, 12 Feb 2006 03:14:48 +0000 (04:14 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 12 Feb 2006 08:26:54 +0000 (00:26 -0800) | ||
commit | 7162dff3dde6fb0a2829fbc8e641fc6d1e7e76ec | |
tree | d033a166979f4ab454550f02352213fee46a52c8 | tree | snapshot |
parent | 16139f9035137ccd81e1e9a9dc203fbede6997a0 | commit | diff |
Add support for explicit type specifiers when calling git-repo-config
Currently, git-repo-config will just return the raw value of option
as specified in the config file; this makes things difficult for scripts
calling it, especially if the value is supposed to be boolean.
This patch makes it possible to ask git-repo-config to check if the option
is of the given type (int or bool) and write out the value in its
canonical form. If you do not pass --int or --bool, the behaviour stays
unchanged and the raw value is emitted.
This also incidentally fixes the segfault when option with no value is
encountered.
[jc: tweaked the option parsing a bit to make it easier to see
that the patch does not change anything but the type stuff in
the diff output. Also changed to avoid "foo ? : bar" construct. ]
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Currently, git-repo-config will just return the raw value of option
as specified in the config file; this makes things difficult for scripts
calling it, especially if the value is supposed to be boolean.
This patch makes it possible to ask git-repo-config to check if the option
is of the given type (int or bool) and write out the value in its
canonical form. If you do not pass --int or --bool, the behaviour stays
unchanged and the raw value is emitted.
This also incidentally fixes the segfault when option with no value is
encountered.
[jc: tweaked the option parsing a bit to make it easier to see
that the patch does not change anything but the type stuff in
the diff output. Also changed to avoid "foo ? : bar" construct. ]
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-repo-config.txt | diff | blob | history | |
repo-config.c | diff | blob | history |