summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a35138a)
raw | patch | inline | side by side (parent: a35138a)
author | Tor Arvid Lund <torarvid@gmail.com> | |
Tue, 15 Mar 2011 12:08:01 +0000 (13:08 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 15 Mar 2011 23:06:58 +0000 (16:06 -0700) |
With this patch, it is possible to call the gitConfig method with an optional
argument string, which will be passed to the "git config" executable. For
instance:
gitConfig("core.ignorecase", "--bool")
will ensure that you get the value "true", and won't have to check the returned
value for [1, true, on, yes].
Signed-off-by: Tor Arvid Lund <torarvid@gmail.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
argument string, which will be passed to the "git config" executable. For
instance:
gitConfig("core.ignorecase", "--bool")
will ensure that you get the value "true", and won't have to check the returned
value for [1, true, on, yes].
Signed-off-by: Tor Arvid Lund <torarvid@gmail.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/fast-import/git-p4 | patch | blob | history |
index 7cb479c5e1b21e4b0de936ced57981e0bf804b0c..4425220bf62afc22f5a6e2c8882411b6d5781267 100755 (executable)
return proc.wait() == 0;
_gitConfig = {}
-def gitConfig(key):
+def gitConfig(key, args = None): # set args to "--bool", for instance
if not _gitConfig.has_key(key):
- _gitConfig[key] = read_pipe("git config %s" % key, ignore_error=True).strip()
+ argsFilter = ""
+ if args != None:
+ argsFilter = "%s " % args
+ cmd = "git config %s%s" % (argsFilter, key)
+ _gitConfig[key] = read_pipe(cmd, ignore_error=True).strip()
return _gitConfig[key]
def p4BranchesInGit(branchesAreInRemotes = True):