git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[StGit PATCH 3/4] Let "stg show" use the unified --diff-opts handling

From
Karl Hasselström <kha@treskal.com>
Date
Jan 24, 2008, 08:08 UTC
Message-ID
<20080124080739.25525.45807.stgit@yoghurt>
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)
Previous: Karl HasselströmNext: Karl Hasselström
Message 7 of 10 in “stgit: config option for diff-opts”
  1. Jon SmirlJan 23, 2008
  2. Karl HasselströmJan 23, 2008
  3. Yann DirsonJan 24, 2008
  4. 0/4 --diff-opts in config fileKarl Hasselström, Jan 24, 2008
  5. 1/4 Remove unused default valuesKarl Hasselström, Jan 24, 2008
  6. 2/4 Refactor --diff-opts handlingKarl Hasselström, Jan 24, 2008
  7. 3/4 Let "stg show" use the unified --diff-opts handlingKarl Hasselström, Jan 24, 2008
  8. 4/4 Read default diff options from the user's configKarl Hasselström, Jan 24, 2008
  9. Karl HasselströmJan 24, 2008
  10. Jon SmirlJan 24, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.