All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Karl Hasselström" <kha@treskal.com>
To: Jon Smirl <jonsmirl@gmail.com>
Cc: git@vger.kernel.org, Catalin Marinas <catalin.marinas@gmail.com>,
	Yann Dirson <ydirson@altern.org>
Subject: [StGit PATCH 4/4] Read default diff options from the user's config
Date: Thu, 24 Jan 2008 09:08:21 +0100	[thread overview]
Message-ID: <20080124080810.25525.82689.stgit@yoghurt> (raw)
In-Reply-To: <20080124075935.25525.24416.stgit@yoghurt>

Signed-off-by: Karl Hasselström <kha@treskal.com>

---

 examples/gitconfig |    4 ++++
 stgit/utils.py     |    3 ++-
 2 files changed, 6 insertions(+), 1 deletions(-)


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 00776b0..69203dc 100644
--- a/stgit/utils.py
+++ b/stgit/utils.py
@@ -320,7 +320,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"')]

  parent reply	other threads:[~2008-01-24  8:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-23  3:04 stgit: config option for diff-opts Jon Smirl
2008-01-23  3:18 ` Karl Hasselström
2008-01-24  7:48   ` Yann Dirson
2008-01-24  8:06     ` [StGit PATCH 0/4] --diff-opts in config file Karl Hasselström
2008-01-24  8:07       ` [StGit PATCH 1/4] Remove unused default values Karl Hasselström
2008-01-24  8:07       ` [StGit PATCH 2/4] Refactor --diff-opts handling Karl Hasselström
2008-01-24  8:08       ` [StGit PATCH 3/4] Let "stg show" use the unified " Karl Hasselström
2008-01-24  8:08       ` Karl Hasselström [this message]
2008-01-24  8:18       ` [StGit PATCH 0/4] --diff-opts in config file Karl Hasselström
2008-01-24 20:20       ` Jon Smirl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080124080810.25525.82689.stgit@yoghurt \
    --to=kha@treskal.com \
    --cc=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jonsmirl@gmail.com \
    --cc=ydirson@altern.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.