{"thread":{"id":"11708","subject":"stgit: config option for diff-opts","startedAt":"2008-01-23T03:04:21Z","lastAt":"2008-01-24T20:20:13Z","messageCount":10,"participants":["Jon Smirl","Karl Hasselström","Yann Dirson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"66362","messageId":"9e4733910801221904k5f66a231t9cb8330eff3861c4@mail.gmail.com","threadId":"11708","inReplyTo":null,"subject":"stgit: config option for diff-opts","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2008-01-23T03:04:21Z","receivedAt":"2008-01-23T03:04:21Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"Could I get a config option added to stgit for diff-opts? So that I\ncan always have git diff -M set on renames.\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"66363","messageId":"20080123031829.GB25508@diana.vm.bytemark.co.uk","threadId":"11708","inReplyTo":"9e4733910801221904k5f66a231t9cb8330eff3861c4@mail.gmail.com","subject":"Re: stgit: config option for diff-opts","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-01-23T03:18:29Z","receivedAt":"2008-01-23T03:18:29Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-01-22 22:04:21 -0500, Jon Smirl wrote:\n\n> Could I get a config option added to stgit for diff-opts? So that I\n> can always have git diff -M set on renames.\n\nGood idea. I've often needed this myself, without consciously\nrealizing it -- my bash is set to save an infinite amount of history,\nso Ctrl+R always helps me out ...\n\nWill whip up, unless someone beats me to it. It's getting sorta late,\nso I won't have time for at least a day or two.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"66453","messageId":"20080124074827.GA29572@nan92-1-81-57-214-146.fbx.proxad.net","threadId":"11708","inReplyTo":"20080123031829.GB25508@diana.vm.bytemark.co.uk","subject":"Re: stgit: config option for diff-opts","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2008-01-24T07:48:27Z","receivedAt":"2008-01-24T07:48:27Z","isPatch":false,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"On Wed, Jan 23, 2008 at 04:18:29AM +0100, Karl Hasselström wrote:\n> On 2008-01-22 22:04:21 -0500, Jon Smirl wrote:\n> \n> > Could I get a config option added to stgit for diff-opts? So that I\n> > can always have git diff -M set on renames.\n> \n> Good idea. I've often needed this myself, without consciously\n> realizing it -- my bash is set to save an infinite amount of history,\n> so Ctrl+R always helps me out ...\n> \n> Will whip up, unless someone beats me to it. It's getting sorta late,\n> so I won't have time for at least a day or two.\n\nI also think that some config stuff should be done, but I could not\ncome with a usable design.\n\nSee eg. http://marc.info/?l=git&m=118102609623481&w=4\n\nAnother problem not explicitely mentionned there is that we my want on\nthe same project to have different settings, eg. for viewing (as\ncompact as possible), exporting (GNU compatibility), and feeding to\nother git commands (with --binary).\n\nBest regards,\n-- \nYann\n"},{"id":"66457","messageId":"20080124075935.25525.24416.stgit@yoghurt","threadId":"11708","inReplyTo":"20080124074827.GA29572@nan92-1-81-57-214-146.fbx.proxad.net","subject":"[StGit PATCH 0/4] --diff-opts in config file","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-01-24T08:06:54Z","receivedAt":"2008-01-24T08:06:54Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"This is first two cleanup patches, followed by one patch that makes\n\"stg show\" handle diff options like the other commands, and last a\npatch that reads diff opts from the config file.\n\nThe first two patches are in kha/safe, but the latter two are in\nkha/experimental because -- as Yann pointed out -- it's good to make\nsure the design is OK before committing to it.\n\nI've solved the problem of overriding the config on the command line\nby making --diff-opts='--foo --bar' _add_ options, and special-cased\n--diff-opts='' to clear all options, including those from the config\nfile, since appending no options makes no sense.\n\nWe'll still have to consider if and how to support different options\nfor different tools.\n\nOh, and Jon: is this what you wanted, by the way? :-)\n\n---\n\nKarl Hasselström (4):\n      Read default diff options from the user's config\n      Let \"stg show\" use the unified --diff-opts handling\n      Refactor --diff-opts handling\n      Remove unused default values\n\n\n examples/gitconfig       |    4 ++++\n stgit/commands/diff.py   |   14 ++++----------\n stgit/commands/edit.py   |   14 +++-----------\n stgit/commands/export.py |   12 +++---------\n stgit/commands/files.py  |   13 ++++---------\n stgit/commands/mail.py   |   12 +++---------\n stgit/commands/show.py   |   13 ++++---------\n stgit/commands/status.py |   17 +++++------------\n stgit/utils.py           |   13 +++++++++++++\n 9 files changed, 43 insertions(+), 69 deletions(-)\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"66458","messageId":"20080124080714.25525.54243.stgit@yoghurt","threadId":"11708","inReplyTo":"20080124075935.25525.24416.stgit@yoghurt","subject":"[StGit PATCH 1/4] Remove unused default values","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-01-24T08:07:20Z","receivedAt":"2008-01-24T08:07:20Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"This function was called from only one place, and the default values\nweren't used there, so they're useless.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n stgit/commands/status.py |    5 ++---\n 1 files changed, 2 insertions(+), 3 deletions(-)\n\n\ndiff --git a/stgit/commands/status.py b/stgit/commands/status.py\nindex 708dd16..02a5832 100644\n--- a/stgit/commands/status.py\n+++ b/stgit/commands/status.py\n@@ -66,9 +66,8 @@ options = [make_option('-m', '--modified',\n                        action = 'store_true')]\n \n \n-def status(files = None, modified = False, new = False, deleted = False,\n-           conflict = False, unknown = False, noexclude = False,\n-           diff_flags = []):\n+def status(files, modified, new, deleted, conflict, unknown, noexclude,\n+           diff_flags):\n     \"\"\"Show the tree status\n     \"\"\"\n     cache_files = git.tree_status(files,\n"},{"id":"66459","messageId":"20080124080726.25525.485.stgit@yoghurt","threadId":"11708","inReplyTo":"20080124075935.25525.24416.stgit@yoghurt","subject":"[StGit PATCH 2/4] Refactor --diff-opts handling","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-01-24T08:07:33Z","receivedAt":"2008-01-24T08:07:33Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"Lots of commands take a -O/--diff-opts flag, and they all handle it\nidentically. So break that out into a library function.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n stgit/commands/diff.py   |   14 ++++----------\n stgit/commands/edit.py   |   14 +++-----------\n stgit/commands/export.py |   12 +++---------\n stgit/commands/files.py  |   13 ++++---------\n stgit/commands/mail.py   |   12 +++---------\n stgit/commands/status.py |   12 +++---------\n stgit/utils.py           |   12 ++++++++++++\n 7 files changed, 32 insertions(+), 57 deletions(-)\n\n\ndiff --git a/stgit/commands/diff.py b/stgit/commands/diff.py\nindex 1425518..7c213d1 100644\n--- a/stgit/commands/diff.py\n+++ b/stgit/commands/diff.py\n@@ -46,12 +46,10 @@ directory = DirectoryHasRepository()\n options = [make_option('-r', '--range',\n                        metavar = 'rev1[..[rev2]]', dest = 'revs',\n                        help = 'show the diff between revisions'),\n-           make_option('-O', '--diff-opts',\n-                       help = 'options to pass to git-diff'),\n            make_option('-s', '--stat',\n                        help = 'show the stat instead of the diff',\n-                       action = 'store_true')]\n-\n+                       action = 'store_true')\n+           ] + make_diff_opts_option()\n \n def func(parser, options, args):\n     \"\"\"Show the tree diff\n@@ -83,16 +81,12 @@ def func(parser, options, args):\n         rev1 = 'HEAD'\n         rev2 = None\n \n-    if options.diff_opts:\n-        diff_flags = options.diff_opts.split()\n-    else:\n-        diff_flags = []\n-\n     if options.stat:\n         out.stdout_raw(git.diffstat(args, git_id(crt_series, rev1),\n                                     git_id(crt_series, rev2)) + '\\n')\n     else:\n         diff_str = git.diff(args, git_id(crt_series, rev1),\n-                            git_id(crt_series, rev2), diff_flags = diff_flags )\n+                            git_id(crt_series, rev2),\n+                            diff_flags = options.diff_flags)\n         if diff_str:\n             pager(diff_str)\ndiff --git a/stgit/commands/edit.py b/stgit/commands/edit.py\nindex 2e8ae37..da67275 100644\n--- a/stgit/commands/edit.py\n+++ b/stgit/commands/edit.py\n@@ -61,8 +61,6 @@ directory = DirectoryGotoToplevel()\n options = [make_option('-d', '--diff',\n                        help = 'edit the patch diff',\n                        action = 'store_true'),\n-           make_option('-O', '--diff-opts',\n-                       help = 'options to pass to git-diff'),\n            make_option('--undo',\n                        help = 'revert the commit generated by the last edit',\n                        action = 'store_true'),\n@@ -80,7 +78,8 @@ options = [make_option('-d', '--diff',\n                        help = 'replace the committer name with COMMNAME'),\n            make_option('--commemail',\n                        help = 'replace the committer e-mail with COMMEMAIL')\n-           ] + make_sign_options() + make_message_options()\n+           ] + (make_sign_options() + make_message_options()\n+                + make_diff_opts_option())\n \n def __update_patch(pname, text, options):\n     \"\"\"Update the current patch from the given text.\n@@ -130,13 +129,6 @@ def __generate_file(pname, write_fn, options):\n     \"\"\"\n     patch = crt_series.get_patch(pname)\n \n-    if options.diff_opts:\n-        if not options.diff:\n-            raise CmdException, '--diff-opts only available with --diff'\n-        diff_flags = options.diff_opts.split()\n-    else:\n-        diff_flags = []\n-\n     # generate the file to be edited\n     descr = patch.get_description().strip()\n     authdate = patch.get_authdate()\n@@ -164,7 +156,7 @@ def __generate_file(pname, write_fn, options):\n \n         tmpl_dict['diffstat'] = git.diffstat(rev1 = bottom, rev2 = top)\n         tmpl_dict['diff'] = git.diff(rev1 = bottom, rev2 = top,\n-                                     diff_flags = diff_flags)\n+                                     diff_flags = options.diff_flags)\n \n     for key in tmpl_dict:\n         # make empty strings if key is not available\ndiff --git a/stgit/commands/export.py b/stgit/commands/export.py\nindex 9131729..16c64ba 100644\n--- a/stgit/commands/export.py\n+++ b/stgit/commands/export.py\n@@ -64,11 +64,10 @@ options = [make_option('-d', '--dir',\n                        help = 'Use FILE as a template'),\n            make_option('-b', '--branch',\n                        help = 'use BRANCH instead of the default one'),\n-           make_option('-O', '--diff-opts',\n-                       help = 'options to pass to git-diff'),\n            make_option('-s', '--stdout',\n                        help = 'dump the patches to the standard output',\n-                       action = 'store_true')]\n+                       action = 'store_true')\n+           ] + make_diff_opts_option()\n \n \n def func(parser, options, args):\n@@ -89,11 +88,6 @@ def func(parser, options, args):\n             os.makedirs(dirname)\n         series = file(os.path.join(dirname, 'series'), 'w+')\n \n-    if options.diff_opts:\n-        diff_flags = options.diff_opts.split()\n-    else:\n-        diff_flags = []\n-\n     applied = crt_series.get_applied()\n     if len(args) != 0:\n         patches = parse_patches(args, applied)\n@@ -180,7 +174,7 @@ def func(parser, options, args):\n         f.write(descr)\n         f.write(git.diff(rev1 = patch.get_bottom(),\n                          rev2 = patch.get_top(),\n-                         diff_flags = diff_flags))\n+                         diff_flags = options.diff_flags))\n         if not options.stdout:\n             f.close()\n         patch_no += 1\ndiff --git a/stgit/commands/files.py b/stgit/commands/files.py\nindex 4550251..ab1f6a3 100644\n--- a/stgit/commands/files.py\n+++ b/stgit/commands/files.py\n@@ -40,11 +40,10 @@ options = [make_option('-s', '--stat',\n                        action = 'store_true'),\n            make_option('-b', '--branch',\n                        help = 'use BRANCH instead of the default one'),\n-           make_option('-O', '--diff-opts',\n-                       help = 'options to pass to git-diff'),\n            make_option('--bare',\n                        help = 'bare file names (useful for scripting)',\n-                       action = 'store_true')]\n+                       action = 'store_true')\n+           ] + make_diff_opts_option()\n \n \n def func(parser, options, args):\n@@ -65,9 +64,5 @@ def func(parser, options, args):\n     elif options.bare:\n         out.stdout_raw(git.barefiles(rev1, rev2) + '\\n')\n     else:\n-        if options.diff_opts:\n-            diff_flags = options.diff_opts.split()\n-        else:\n-            diff_flags = []\n-\n-        out.stdout_raw(git.files(rev1, rev2, diff_flags = diff_flags) + '\\n')\n+        out.stdout_raw(git.files(rev1, rev2, diff_flags = options.diff_flags)\n+                       + '\\n')\ndiff --git a/stgit/commands/mail.py b/stgit/commands/mail.py\nindex eea84f2..4aa16fb 100644\n--- a/stgit/commands/mail.py\n+++ b/stgit/commands/mail.py\n@@ -144,11 +144,10 @@ options = [make_option('-a', '--all',\n                        action = 'store_true'),\n            make_option('-b', '--branch',\n                        help = 'use BRANCH instead of the default one'),\n-           make_option('-O', '--diff-opts',\n-                       help = 'options to pass to git-diff'),\n            make_option('-m', '--mbox',\n                        help = 'generate an mbox file instead of sending',\n-                       action = 'store_true')]\n+                       action = 'store_true')\n+           ] + make_diff_opts_option()\n \n \n def __get_sender():\n@@ -426,11 +425,6 @@ def __build_message(tmpl, patch, patch_nr, total_nr, msg_id, ref_id, options):\n             prefix_str = confprefix + ' '\n         else:\n             prefix_str = ''\n-        \n-    if options.diff_opts:\n-        diff_flags = options.diff_opts.split()\n-    else:\n-        diff_flags = []\n \n     total_nr_str = str(total_nr)\n     patch_nr_str = str(patch_nr).zfill(len(total_nr_str))\n@@ -450,7 +444,7 @@ def __build_message(tmpl, patch, patch_nr, total_nr, msg_id, ref_id, options):\n                  'diff':         git.diff(\n                      rev1 = git_id(crt_series, '%s//bottom' % patch),\n                      rev2 = git_id(crt_series, '%s//top' % patch),\n-                     diff_flags = diff_flags),\n+                     diff_flags = options.diff_flags),\n                  'diffstat':     git.diffstat(\n                      rev1 = git_id(crt_series, '%s//bottom'%patch),\n                      rev2 = git_id(crt_series, '%s//top' % patch)),\ndiff --git a/stgit/commands/status.py b/stgit/commands/status.py\nindex 02a5832..6da4516 100644\n--- a/stgit/commands/status.py\n+++ b/stgit/commands/status.py\n@@ -59,11 +59,10 @@ options = [make_option('-m', '--modified',\n            make_option('-x', '--noexclude',\n                        help = 'do not exclude any files from listing',\n                        action = 'store_true'),\n-           make_option('-O', '--diff-opts',\n-                       help = 'options to pass to git-diff'),\n            make_option('--reset',\n                        help = 'reset the current tree changes',\n-                       action = 'store_true')]\n+                       action = 'store_true')\n+           ] + make_diff_opts_option()\n \n \n def status(files, modified, new, deleted, conflict, unknown, noexclude,\n@@ -115,11 +114,6 @@ def func(parser, options, args):\n             resolved_all()\n             git.reset()\n     else:\n-        if options.diff_opts:\n-            diff_flags = options.diff_opts.split()\n-        else:\n-            diff_flags = []\n-\n         status(args, options.modified, options.new, options.deleted,\n                options.conflict, options.unknown, options.noexclude,\n-               diff_flags = diff_flags)\n+               options.diff_flags)\ndiff --git a/stgit/utils.py b/stgit/utils.py\nindex 2ff1d74..00776b0 100644\n--- a/stgit/utils.py\n+++ b/stgit/utils.py\n@@ -313,6 +313,18 @@ def make_message_options():\n               metavar = 'FILE', dest = 'save_template', type = 'string',\n               help = 'save the message template to FILE and exit')]\n \n+def make_diff_opts_option():\n+    def diff_opts_callback(option, opt_str, value, parser):\n+        if value:\n+            parser.values.diff_flags.extend(value.split())\n+        else:\n+            parser.values.diff_flags = []\n+    return [optparse.make_option(\n+        '-O', '--diff-opts', dest = 'diff_flags', default = [],\n+        action = 'callback', callback = diff_opts_callback,\n+        type = 'string', metavar = 'OPTIONS',\n+        help = 'extra options to pass to \"git diff\"')]\n+\n # Exit codes.\n STGIT_SUCCESS = 0        # everything's OK\n STGIT_GENERAL_ERROR = 1  # seems to be non-command-specific error\n"},{"id":"66460","messageId":"20080124080739.25525.45807.stgit@yoghurt","threadId":"11708","inReplyTo":"20080124075935.25525.24416.stgit@yoghurt","subject":"[StGit PATCH 3/4] Let \"stg show\" use the unified --diff-opts handling","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-01-24T08:08:04Z","receivedAt":"2008-01-24T08:08:04Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"This introduces a small UI change: \"stg show\" called that flag\n--show-opts. This could of course be avoided, but I don't think it's\nworth it, since git-diff and git-show accept mostly the same options.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\nCatalin, do you agree?\n\n stgit/commands/show.py |   13 ++++---------\n 1 files changed, 4 insertions(+), 9 deletions(-)\n\n\ndiff --git a/stgit/commands/show.py b/stgit/commands/show.py\nindex 72d1be3..b77a9c8 100644\n--- a/stgit/commands/show.py\n+++ b/stgit/commands/show.py\n@@ -38,9 +38,8 @@ options = [make_option('-b', '--branch',\n                        action = 'store_true'),\n            make_option('-u', '--unapplied',\n                        help = 'show the unapplied patches',\n-                       action = 'store_true'),\n-           make_option('-O', '--show-opts',\n-                       help = 'options to pass to \"git show\"')]\n+                       action = 'store_true')\n+           ] + make_diff_opts_option()\n \n \n def func(parser, options, args):\n@@ -62,13 +61,9 @@ def func(parser, options, args):\n             patches = parse_patches(args, applied + unapplied + \\\n                                     crt_series.get_hidden(), len(applied))\n \n-    if options.show_opts:\n-        show_flags = options.show_opts.split()\n-    else:\n-        show_flags = []\n-\n     commit_ids = [git_id(crt_series, patch) for patch in patches]\n-    commit_str = '\\n'.join([git.pretty_commit(commit_id, flags = show_flags)\n+    commit_str = '\\n'.join([git.pretty_commit(commit_id,\n+                                              flags = options.diff_flags)\n                             for commit_id in commit_ids])\n     if commit_str:\n         pager(commit_str)\n"},{"id":"66461","messageId":"20080124080810.25525.82689.stgit@yoghurt","threadId":"11708","inReplyTo":"20080124075935.25525.24416.stgit@yoghurt","subject":"[StGit PATCH 4/4] Read default diff options from the user's config","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-01-24T08:08:21Z","receivedAt":"2008-01-24T08:08:21Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"Signed-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n examples/gitconfig |    4 ++++\n stgit/utils.py     |    3 ++-\n 2 files changed, 6 insertions(+), 1 deletions(-)\n\n\ndiff --git a/examples/gitconfig b/examples/gitconfig\nindex cd9b569..c16f786 100644\n--- a/examples/gitconfig\n+++ b/examples/gitconfig\n@@ -95,6 +95,10 @@\n \t# The maximum length of an automatically generated patch name\n \t#namelenth = 30\n \n+\t# Extra options to pass to \"git diff\" (extend/override with\n+\t# -O/--diff-opts). For example, -M turns on rename detection.\n+\t#diff-opts = -M\n+\n [mail \"alias\"]\n \t# E-mail aliases used with the 'mail' command\n \tgit = git@vger.kernel.org\ndiff --git a/stgit/utils.py b/stgit/utils.py\nindex 00776b0..69203dc 100644\n--- a/stgit/utils.py\n+++ b/stgit/utils.py\n@@ -320,7 +320,8 @@ def make_diff_opts_option():\n         else:\n             parser.values.diff_flags = []\n     return [optparse.make_option(\n-        '-O', '--diff-opts', dest = 'diff_flags', default = [],\n+        '-O', '--diff-opts', dest = 'diff_flags',\n+        default = (config.get('stgit.diff-opts') or '').split(),\n         action = 'callback', callback = diff_opts_callback,\n         type = 'string', metavar = 'OPTIONS',\n         help = 'extra options to pass to \"git diff\"')]\n"},{"id":"66463","messageId":"20080124081819.GA20346@diana.vm.bytemark.co.uk","threadId":"11708","inReplyTo":"20080124075935.25525.24416.stgit@yoghurt","subject":"Re: [StGit PATCH 0/4] --diff-opts in config file","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-01-24T08:18:19Z","receivedAt":"2008-01-24T08:18:19Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-01-24 09:06:54 +0100, Karl Hasselström wrote:\n\n> I've solved the problem of overriding the config on the command line\n> by making --diff-opts='--foo --bar' _add_ options, and special-cased\n> --diff-opts='' to clear all options, including those from the config\n> file, since appending no options makes no sense.\n\nMph. I just realized that none of the patches add any documentation\nthat explains this.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"66515","messageId":"9e4733910801241220j5a470d12s3378d338797e01be@mail.gmail.com","threadId":"11708","inReplyTo":"20080124075935.25525.24416.stgit@yoghurt","subject":"Re: [StGit PATCH 0/4] --diff-opts in config file","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2008-01-24T20:20:13Z","receivedAt":"2008-01-24T20:20:13Z","isPatch":true,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"On 1/24/08, Karl Hasselström <kha@treskal.com> wrote:\n> This is first two cleanup patches, followed by one patch that makes\n> \"stg show\" handle diff options like the other commands, and last a\n> patch that reads diff opts from the config file.\n>\n> The first two patches are in kha/safe, but the latter two are in\n> kha/experimental because -- as Yann pointed out -- it's good to make\n> sure the design is OK before committing to it.\n>\n> I've solved the problem of overriding the config on the command line\n> by making --diff-opts='--foo --bar' _add_ options, and special-cased\n> --diff-opts='' to clear all options, including those from the config\n> file, since appending no options makes no sense.\n>\n> We'll still have to consider if and how to support different options\n> for different tools.\n>\n> Oh, and Jon: is this what you wanted, by the way? :-)\n\nThis patch series is fine for my uses.\n\n>\n> ---\n>\n> Karl Hasselström (4):\n>       Read default diff options from the user's config\n>       Let \"stg show\" use the unified --diff-opts handling\n>       Refactor --diff-opts handling\n>       Remove unused default values\n>\n>\n>  examples/gitconfig       |    4 ++++\n>  stgit/commands/diff.py   |   14 ++++----------\n>  stgit/commands/edit.py   |   14 +++-----------\n>  stgit/commands/export.py |   12 +++---------\n>  stgit/commands/files.py  |   13 ++++---------\n>  stgit/commands/mail.py   |   12 +++---------\n>  stgit/commands/show.py   |   13 ++++---------\n>  stgit/commands/status.py |   17 +++++------------\n>  stgit/utils.py           |   13 +++++++++++++\n>  9 files changed, 43 insertions(+), 69 deletions(-)\n>\n> --\n> Karl Hasselström, kha@treskal.com\n>       www.treskal.com/kalle\n>\n\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"}]}