git.vger.kernel.org archive mirror
 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 3/4] Let "stg show" use the unified --diff-opts handling
Date: Thu, 24 Jan 2008 09:08:04 +0100	[thread overview]
Message-ID: <20080124080739.25525.45807.stgit@yoghurt> (raw)
In-Reply-To: <20080124075935.25525.24416.stgit@yoghurt>

This introduces a small UI change: "stg show" called that flag
--show-opts. This could of course be avoided, but I don't think it's
worth it, since git-diff and git-show accept mostly the same options.

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

---

Catalin, do you agree?

 stgit/commands/show.py |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)


diff --git a/stgit/commands/show.py b/stgit/commands/show.py
index 72d1be3..b77a9c8 100644
--- a/stgit/commands/show.py
+++ b/stgit/commands/show.py
@@ -38,9 +38,8 @@ options = [make_option('-b', '--branch',
                        action = 'store_true'),
            make_option('-u', '--unapplied',
                        help = 'show the unapplied patches',
-                       action = 'store_true'),
-           make_option('-O', '--show-opts',
-                       help = 'options to pass to "git show"')]
+                       action = 'store_true')
+           ] + make_diff_opts_option()
 
 
 def func(parser, options, args):
@@ -62,13 +61,9 @@ def func(parser, options, args):
             patches = parse_patches(args, applied + unapplied + \
                                     crt_series.get_hidden(), len(applied))
 
-    if options.show_opts:
-        show_flags = options.show_opts.split()
-    else:
-        show_flags = []
-
     commit_ids = [git_id(crt_series, patch) for patch in patches]
-    commit_str = '\n'.join([git.pretty_commit(commit_id, flags = show_flags)
+    commit_str = '\n'.join([git.pretty_commit(commit_id,
+                                              flags = options.diff_flags)
                             for commit_id in commit_ids])
     if commit_str:
         pager(commit_str)

  parent reply	other threads:[~2008-01-24  8:08 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       ` Karl Hasselström [this message]
2008-01-24  8:08       ` [StGit PATCH 4/4] Read default diff options from the user's config Karl Hasselström
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=20080124080739.25525.45807.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).