From faed67707d8377ddb68fa8ba199d85ed90d1f27c Mon Sep 17 00:00:00 2001 From: Paolo 'Blaisorblade' Giarrusso Date: Fri, 16 Sep 2005 21:35:17 +0200 Subject: [PATCH] Make "stg files" output match "quilt files" one I'm used to doing vi $(quilt files), which is impossible with stgit. Add an option (-b/--base) to request the normal behaviour, but make it non-default as the current output is useful. Signed-off-by: Paolo 'Blaisorblade' Giarrusso --- stgit/commands/files.py | 6 ++++++ stgit/git.py | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/stgit/commands/files.py b/stgit/commands/files.py index d81bc25..4b44f72 100644 --- a/stgit/commands/files.py +++ b/stgit/commands/files.py @@ -38,6 +38,10 @@ options = [make_option('-s', '--stat', action = 'store_true'), make_option('-b', '--branch', help = 'use BRANCH instead of the default one')] + action = 'store_true'), + make_option('--bare', + help = 'bare file names (useful for scripting)', + action = 'store_true')] def func(parser, options, args): @@ -55,5 +59,7 @@ def func(parser, options, args): if options.stat: print git.diffstat(rev1 = rev1, rev2 = rev2) + elif options.bare: + print git.barefiles(rev1, rev2) else: print git.files(rev1, rev2) diff --git a/stgit/git.py b/stgit/git.py index ae5506b..2661622 100644 --- a/stgit/git.py +++ b/stgit/git.py @@ -421,6 +421,16 @@ def files(rev1, rev2): return str.rstrip() +def barefiles(rev1, rev2): + """Return the files modified between rev1 and rev2, without status info + """ + + str = '' + for line in _output_lines('git-diff-tree -r %s %s' % (rev1, rev2)): + str += '%s\n' % line.rstrip().split(' ',4)[-1].split('\t',1)[-1] + + return str.rstrip() + def checkout(files = [], tree_id = None, force = False): """Check out the given or all files """ -- 2.11.0