]> thyrsus.com Git - src.git/commitdiff
Documentation for src diff.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 16 Nov 2014 06:29:07 +0000 (01:29 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 16 Nov 2014 06:29:07 +0000 (01:29 -0500)
src
src.asc

diff --git a/src b/src
index 529933e79c0f0eeb77e6df2d2c8af917ad2c38ff..8a85c35970626efa3c443d4c70560252f38e80f6 100755 (executable)
--- a/src
+++ b/src
@@ -270,6 +270,7 @@ cat         -- the cat command: dumping revisions to standard output.
 status      -- the status command: more details and unusual status codes.
 log         -- the log command: dump commit log information to standard output.
 list        -- the list command: dump commit summaries to standard output.
+diff        -- the diff command: dump revision differences to standard output.
 fast-export -- the fast-export command: export history to other systems.
 ignores     -- .srcignore files and their uses.
 """,
@@ -563,6 +564,20 @@ of beginning each commit with a self-contained summary line.
 With no revision, dumps a log of the entire current branch.
 
 'li' is a synonym for 'list'.
+""",   
+   "diff" : """
+src diff ['revision-range'] ['file'...]
+
+Sends a diff listing to standard output. 'di' is a synonym.
+
+With no revision spec, diffs the working copy against the last version
+checked in. With one revno, diffs the working copy against that stored
+revision; with a range, diff between the beginning and end of the
+range.
+
+The actual difference generation is done with diff(1),  The default
+diff format is -u, but if you specify options such as -c or -b after
+the verb they will be passed to the command.
 """,   
    "fast-export" : """
 src fast-export ['revision-range'] ['file'...]
@@ -1047,9 +1062,11 @@ def diff_method(*args):
     ctx = CommandContext("diff", args)
     if type(args) == type(()):
         args = list(args)
-    diffopts = "-u"
+    diffopts = ""
     while args and args[0].startswith("-"):
         diffopts += " " + args.pop(0)
+    if not diffopts:
+        diffopts = "-u"
     for arg in ctx.args:
         diffspec1 = diffspec2 = ""
         if not ctx.is_empty():
@@ -1328,6 +1345,7 @@ dispatch = {
     "st":          status_method,
     "cat":         cat_method,
     "diff":        diff_method,
+    "di":          diff_method,
     "tag":         tag_method,
     "branch":      branch_method,
     "ls":          ls_method,
diff --git a/src.asc b/src.asc
index d29d1d97d5af58625e22993e70b65698c0967e38..f8f02548499701d62d3dbba52ab3f3e2a89464e6 100644 (file)
--- a/src.asc
+++ b/src.asc
@@ -100,7 +100,8 @@ src diff ['revision-range'] ['file'...]::
    Sends a diff listing to standard output. With no revision spec, diffs
    the working copy against the last version checked in. With one revno,
    diffs the working copy against that stored revision; with a range,
-   diff between the beginning and end of the range.
+   diff between the beginning and end of the range. "di" is a synonym
+   for "diff".
 
 src ls::
    List all registered files.