summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Hellmann <doug@doughellmann.com>2017-10-19 18:27:19 -0400
committerDoug Hellmann <doug@doughellmann.com>2017-10-19 18:27:19 -0400
commit84511b112415b0a02abe6dee67472a52db2d79d1 (patch)
tree7244193582210d4c3cb1228ead3ec13e6b430e26
parentb61f5b2ec9ab140960a1c6e0a424389cdd8951a0 (diff)
downloadgit-review-84511b112415b0a02abe6dee67472a52db2d79d1.tar.gz
show the config value result after fetching it in verbose mode
We show the command used to retrieve the config value, but don't show what we find. Fix that, and also show cases where we are going to use the default setting. Change-Id: I53ee9ea6e3af4e951587c0845c8333874238f0c2 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
-rwxr-xr-xgit_review/cmd.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/git_review/cmd.py b/git_review/cmd.py
index b0956ff..89ebae8 100755
--- a/git_review/cmd.py
+++ b/git_review/cmd.py
@@ -278,9 +278,14 @@ def git_config_get_value(section, option, default=None, as_bool=False):
__, git_dir = git_directories()
cmd[2:2] = ['-f', os.path.join(git_dir, 'config')]
try:
- return run_command_exc(GitConfigException, *cmd).strip()
+ result = run_command_exc(GitConfigException, *cmd).strip()
+ if VERBOSE:
+ print(datetime.datetime.now(), "result:", result)
+ return result
except GitConfigException as exc:
if exc.rc == 1:
+ if VERBOSE:
+ print(datetime.datetime.now(), "using default:", default)
return default
raise