patches. The output is similar to that generated by the 'git show'
command."""
+directory = DirectoryHasRepository()
options = [make_option('-b', '--branch',
help = 'use BRANCH instead of the default one'),
make_option('-a', '--applied',
make_option('-u', '--unapplied',
help = 'show the unapplied patches',
action = 'store_true'),
- make_option('-O', '--diff-opts',
- help = 'options to pass to git-diff')]
+ make_option('-O', '--show-opts',
+ help = 'options to pass to "git show"')]
def func(parser, options, args):
elif len(args) == 0:
patches = ['HEAD']
else:
- patches = parse_patches(args, applied + unapplied, len(applied))
+ 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:
- diff_flags = options.diff_opts.split()
+ if options.show_opts:
+ show_flags = options.show_opts.split()
else:
- diff_flags = []
+ show_flags = []
- commit_ids = [git_id(patch) for patch in patches]
- commit_str = '\n'.join([git.pretty_commit(commit_id, diff_flags=diff_flags)
+ commit_ids = [git_id(crt_series, patch) for patch in patches]
+ commit_str = '\n'.join([git.pretty_commit(commit_id, flags = show_flags)
for commit_id in commit_ids])
if commit_str:
pager(commit_str)