X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/fcee87cf868f18a3d684c3ba71232574f92c7b11..fcc1ad70be5ff89996358b6d770cd229fec2a3ba:/stgit/commands/diff.py diff --git a/stgit/commands/diff.py b/stgit/commands/diff.py index 6036a18..5645eca 100644 --- a/stgit/commands/diff.py +++ b/stgit/commands/diff.py @@ -27,7 +27,18 @@ from stgit import stack, git help = 'show the tree diff' usage = """%prog [options] [] -The revision format is '([patch]/[bottom | top]) | '""" +Show the diff (default) or diffstat between the current working copy +or a tree-ish object and another tree-ish object. File names can also +be given to restrict the diff output. The tree-ish object can be a +standard git commit, tag or tree. In addition to these, the command +also supports 'base', representing the bottom of the current stack, +and '[patch]/[bottom | top]' for the patch boundaries (defaulting to +the current one): + +rev = '([patch]/[bottom | top]) | | base' + +If neither bottom or top are given but a '/' is present, the command +shows the specified patch (defaulting to the current one).""" options = [make_option('-r', metavar = 'rev1[:[rev2]]', dest = 'revs', help = 'show the diff between revisions'), @@ -53,8 +64,6 @@ def func(parser, options, args): elif rev_list_len == 2: rev1 = rev_list[0] rev2 = rev_list[1] - if rev2 == '': - rev2 = 'HEAD' else: parser.error('incorrect parameters to -r') else: @@ -64,4 +73,4 @@ def func(parser, options, args): if options.stat: print git.diffstat(args, git_id(rev1), git_id(rev2)) else: - git.diff(args, git_id(rev1), git_id(rev2)) + git.diff(args, git_id(rev1), git_id(rev2), sys.stdout)