chiark / gitweb /
Revert 'Disallow non-patch args to "stg show" (gna #8453).'
authorYann Dirson <ydirson@altern.org>
Mon, 16 Jul 2007 22:48:29 +0000 (23:48 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Mon, 16 Jul 2007 22:48:29 +0000 (23:48 +0100)
This patch has a lot of side-effects that will break people's
expectations.  There is much more that just this to do if we want to
sanitize patch/commit/range addressing on the command-line, so that
will wait till after 0.13.

Signed-off-by: Yann Dirson <ydirson@altern.org>
stgit/commands/show.py

index 2b2274491cdd7ef949e58ac5d1ec018f4b32d550..45ca253a58cdfe90bd2b5e9557db68bce691733b 100644 (file)
@@ -55,7 +55,12 @@ def func(parser, options, args):
     elif len(args) == 0:
         patches = ['HEAD']
     else:
-        patches = parse_patches(args, applied + unapplied +\
+        if len(args) == 1 and args[0].find('..') == -1 \
+               and not crt_series.patch_exists(args[0]):
+            # it might be just a commit id
+            patches = args
+        else:
+            patches = parse_patches(args, applied + unapplied +\
                                 crt_series.get_hidden(), len(applied))
 
     if options.diff_opts: