From dcbb2c6afa8be9112eefb7793e75dc19e1ad6992 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Thu, 24 Jan 2008 04:20:24 +0100 Subject: [PATCH] Read default diff options from the user's config MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Organization: Straylight/Edgeware From: Karl Hasselström Signed-off-by: Karl Hasselström --- examples/gitconfig | 4 ++++ stgit/utils.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/gitconfig b/examples/gitconfig index cd9b569..c16f786 100644 --- a/examples/gitconfig +++ b/examples/gitconfig @@ -95,6 +95,10 @@ # The maximum length of an automatically generated patch name #namelenth = 30 + # Extra options to pass to "git diff" (extend/override with + # -O/--diff-opts). For example, -M turns on rename detection. + #diff-opts = -M + [mail "alias"] # E-mail aliases used with the 'mail' command git = git@vger.kernel.org diff --git a/stgit/utils.py b/stgit/utils.py index 43366c9..b75c3b4 100644 --- a/stgit/utils.py +++ b/stgit/utils.py @@ -316,7 +316,8 @@ def make_diff_opts_option(): else: parser.values.diff_flags = [] return [optparse.make_option( - '-O', '--diff-opts', dest = 'diff_flags', default = [], + '-O', '--diff-opts', dest = 'diff_flags', + default = (config.get('stgit.diff-opts') or '').split(), action = 'callback', callback = diff_opts_callback, type = 'string', metavar = 'OPTIONS', help = 'extra options to pass to "git diff"')] -- [mdw]