[svnbook] r4049 committed - This covers:...
svnbook at googlecode.com
svnbook at googlecode.com
Tue Aug 30 09:50:38 CDT 2011
Revision: 4049
Author: cmpilato at gmail.com
Date: Tue Aug 30 07:49:52 2011
Log: This covers:
Issue 118: ("1.7 change: New 'svn log --diff' option")
Issue 119: ("1.7 change: New 'svn diff --git' option.")
* en/book/ch02-basic-usage.xml
Move the coverage of 'svn log' to after 'svn diff', and then call
out the special 'svn log --diff' functionality as a handy shortcut.
* en/book/ch09-reference.xml
Document the following:
svn diff --internal-diff
svn diff --git
svn diff --show-copies-as-adds
svn log --depth
svn log --diff
svn log --diff-cmd
svn log --extensions
svn log --internal-diff
http://code.google.com/p/svnbook/source/detail?r=4049
Modified:
/trunk/en/book/ch02-basic-usage.xml
/trunk/en/book/ch09-reference.xml
=======================================
--- /trunk/en/book/ch02-basic-usage.xml Mon Aug 15 12:22:38 2011
+++ /trunk/en/book/ch02-basic-usage.xml Tue Aug 30 07:49:52 2011
@@ -2081,18 +2081,18 @@
<variablelist>
<varlistentry>
- <term><command>svn log</command></term>
+ <term><command>svn diff</command></term>
<listitem>
- <para>Shows you broad information: log messages with date
- and author information attached to revisions and which
- paths changed in each revision</para>
+ <para>Shows line-level details of a particular change</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><command>svn diff</command></term>
+ <term><command>svn log</command></term>
<listitem>
- <para>Shows line-level details of a particular change</para>
+ <para>Shows you broad information: log messages with date
+ and author information attached to revisions and which
+ paths changed in each revision</para>
</listitem>
</varlistentry>
@@ -2115,6 +2115,156 @@
</variablelist>
+ <!-- ===============================================================
-->
+ <sect2 id="svn.tour.history.diff">
+ <title>Examining the Details of Historical Changes</title>
+
+ <para>We've already seen <command>svn diff</command>
+ before—it displays file differences in unified diff
+ format; we used it to show the local modifications made to
+ our working copy before committing to the repository.</para>
+
+ <para>In fact, it turns out that there are
+ <emphasis>three</emphasis> distinct uses of <command>svn
+ diff</command>:</para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>Examining local changes</para>
+ </listitem>
+
+ <listitem>
+ <para>Comparing your working copy to the repository</para>
+ </listitem>
+
+ <listitem>
+ <para>Comparing repository revisions</para>
+ </listitem>
+
+ </itemizedlist>
+
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
+ <sect3 id="svn.tour.history.diff.local">
+ <title>Examining local changes</title>
+
+ <para>As we've seen, invoking <userinput>svn diff</userinput> with
+ no options will compare your working files to the cached
+ <quote>pristine</quote> copies in
+ the <filename>.svn</filename> area:</para>
+
+ <informalexample>
+ <screen>
+$ svn diff
+Index: rules.txt
+===================================================================
+--- rules.txt (revision 3)
++++ rules.txt (working copy)
+@@ -1,4 +1,5 @@
+ Be kind to others
+ Freedom = Responsibility
+ Everything in moderation
+-Chew with your mouth open
++Chew with your mouth closed
++Listen when others are speaking
+$
+</screen>
+ </informalexample>
+
+ </sect3>
+
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
+ <sect3 id="svn.tour.history.diff.wcrepos">
+ <title>Comparing working copy to repository</title>
+
+ <para>If a single <option>--revision</option>
+ (<option>-r</option>) number is passed, your
+ working copy is compared to the specified revision in the
+ repository:</para>
+
+ <informalexample>
+ <screen>
+$ svn diff -r 3 rules.txt
+Index: rules.txt
+===================================================================
+--- rules.txt (revision 3)
++++ rules.txt (working copy)
+@@ -1,4 +1,5 @@
+ Be kind to others
+ Freedom = Responsibility
+ Everything in moderation
+-Chew with your mouth open
++Chew with your mouth closed
++Listen when others are speaking
+$
+</screen>
+ </informalexample>
+
+ </sect3>
+
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
+ <sect3 id="svn.tour.history.diff.reposrepos">
+ <title>Comparing repository revisions</title>
+
+ <para>If two revision numbers, separated by a colon, are
+ passed via <option>--revision</option>
+ (<option>-r</option>), the two revisions are directly
+ compared:</para>
+
+ <informalexample>
+ <screen>
+$ svn diff -r 2:3 rules.txt
+Index: rules.txt
+===================================================================
+--- rules.txt (revision 2)
++++ rules.txt (revision 3)
+@@ -1,4 +1,4 @@
+ Be kind to others
+-Freedom = Chocolate Ice Cream
++Freedom = Responsibility
+ Everything in moderation
+ Chew with your mouth open
+$
+</screen>
+ </informalexample>
+
+ <para>A more convenient way of comparing one revision to the
+ previous revision is to use the <option>--change</option>
+ (<option>-c</option>) option:</para>
+
+ <informalexample>
+ <screen>
+$ svn diff -c 3 rules.txt
+Index: rules.txt
+===================================================================
+--- rules.txt (revision 2)
++++ rules.txt (revision 3)
+@@ -1,4 +1,4 @@
+ Be kind to others
+-Freedom = Chocolate Ice Cream
++Freedom = Responsibility
+ Everything in moderation
+ Chew with your mouth open
+$
+</screen>
+ </informalexample>
+
+ <para>Lastly, you can compare repository revisions even when
+ you don't have a working copy on your local machine, just by
+ including the appropriate URL on the command line:</para>
+
+ <informalexample>
+ <screen>
+$ svn diff -c 5 http://svn.example.com/repos/example/trunk/text/rules.txt
+…
+$
+</screen>
+ </informalexample>
+
+ </sect3>
+
+ </sect2>
+
<!-- ===============================================================
-->
<sect2 id="svn.tour.history.log">
<title>Generating a List of Historical Changes</title>
@@ -2248,8 +2398,7 @@
</screen>
</informalexample>
- <para>
- <command>svn log</command> also takes
+ <para><command>svn log</command> also takes
a <option>--quiet</option> (<option>-q</option>) option, which
suppresses the body of the log message. When combined
with <option>--verbose</option> (<option>-v</option>), it
@@ -2285,155 +2434,17 @@
</sidebar>
- </sect2>
-
- <!-- ===============================================================
-->
- <sect2 id="svn.tour.history.diff">
- <title>Examining the Details of Historical Changes</title>
-
- <para>We've already seen <command>svn diff</command>
- before—it displays file differences in unified diff
- format; we used it to show the local modifications made to
- our working copy before committing to the repository.</para>
-
- <para>In fact, it turns out that there are
- <emphasis>three</emphasis> distinct uses of <command>svn
- diff</command>:</para>
-
- <itemizedlist>
-
- <listitem>
- <para>Examining local changes</para>
- </listitem>
-
- <listitem>
- <para>Comparing your working copy to the repository</para>
- </listitem>
-
- <listitem>
- <para>Comparing repository revisions</para>
- </listitem>
-
- </itemizedlist>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
- <sect3 id="svn.tour.history.diff.local">
- <title>Examining local changes</title>
-
- <para>As we've seen, invoking <userinput>svn diff</userinput> with
- no options will compare your working files to the cached
- <quote>pristine</quote> copies in
- the <filename>.svn</filename> area:</para>
-
- <informalexample>
- <screen>
-$ svn diff
-Index: rules.txt
-===================================================================
---- rules.txt (revision 3)
-+++ rules.txt (working copy)
-@@ -1,4 +1,5 @@
- Be kind to others
- Freedom = Responsibility
- Everything in moderation
--Chew with your mouth open
-+Chew with your mouth closed
-+Listen when others are speaking
-$
-</screen>
- </informalexample>
-
- </sect3>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
- <sect3 id="svn.tour.history.diff.wcrepos">
- <title>Comparing working copy to repository</title>
-
- <para>If a single <option>--revision</option>
- (<option>-r</option>) number is passed, your
- working copy is compared to the specified revision in the
- repository:</para>
-
- <informalexample>
- <screen>
-$ svn diff -r 3 rules.txt
-Index: rules.txt
-===================================================================
---- rules.txt (revision 3)
-+++ rules.txt (working copy)
-@@ -1,4 +1,5 @@
- Be kind to others
- Freedom = Responsibility
- Everything in moderation
--Chew with your mouth open
-+Chew with your mouth closed
-+Listen when others are speaking
-$
-</screen>
- </informalexample>
-
- </sect3>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
- <sect3 id="svn.tour.history.diff.reposrepos">
- <title>Comparing repository revisions</title>
-
- <para>If two revision numbers, separated by a colon, are
- passed via <option>--revision</option>
- (<option>-r</option>), the two revisions are directly
- compared:</para>
-
- <informalexample>
- <screen>
-$ svn diff -r 2:3 rules.txt
-Index: rules.txt
-===================================================================
---- rules.txt (revision 2)
-+++ rules.txt (revision 3)
-@@ -1,4 +1,4 @@
- Be kind to others
--Freedom = Chocolate Ice Cream
-+Freedom = Responsibility
- Everything in moderation
- Chew with your mouth open
-$
-</screen>
- </informalexample>
-
- <para>A more convenient way of comparing one revision to the
- previous revision is to use the <option>--change</option>
- (<option>-c</option>) option:</para>
-
- <informalexample>
- <screen>
-$ svn diff -c 3 rules.txt
-Index: rules.txt
-===================================================================
---- rules.txt (revision 2)
-+++ rules.txt (revision 3)
-@@ -1,4 +1,4 @@
- Be kind to others
--Freedom = Chocolate Ice Cream
-+Freedom = Responsibility
- Everything in moderation
- Chew with your mouth open
-$
-</screen>
- </informalexample>
-
- <para>Lastly, you can compare repository revisions even when
- you don't have a working copy on your local machine, just by
- including the appropriate URL on the command line:</para>
-
- <informalexample>
- <screen>
-$ svn diff -c 5 http://svn.example.com/repos/example/trunk/text/rules.txt
-…
-$
-</screen>
- </informalexample>
-
- </sect3>
+ <para>As of Subversion 1.7, users of the Subversion command-line
+ can also take advantage of a special output mode
+ for <command>svn log</command> which integrates a difference
+ report such as is generated by the <command>svn diff</command>
+ command we introduced earlier. When you invoke <command>svn
+ log</command> with the <option>--diff</option> option,
+ Subversion will append to each revision log chunk in the log
+ report a <command>diff</command>-style difference report.
+ This is a very convenient way to see both high-level, semantic
+ changes and the line-based modifications of a revisions all at
+ the same time!</para>
</sect2>
=======================================
--- /trunk/en/book/ch09-reference.xml Tue Aug 30 06:42:07 2011
+++ /trunk/en/book/ch09-reference.xml Tue Aug 30 07:49:52 2011
@@ -240,6 +240,16 @@
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>--diff</option></term>
+ <listitem>
+ <para>Enables a special output mode for <command>svn
+ log</command> which includes a difference report (a
+ la <command>svn diff</command>) as part of each
+ revision's information.</para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><option>--diff-cmd</option>
<replaceable>CMD</replaceable></term>
@@ -302,11 +312,11 @@
<para>Specifies an argument or arguments that Subversion
should pass to an external diff command. This option is
valid only when used with the <command>svn
- diff</command> or <command>svn merge</command> commands,
- with the
- <option>--diff-cmd</option> option.
- If you wish to pass multiple
- arguments, you must enclose all of them in quotes (e.g.,
+ diff</command>, <command>svn merge</command>,
+ or <command>svn log --diff</command> commands, where the
+ <option>--diff-cmd</option> option was also used. If
+ you wish to pass multiple arguments, you must enclose
+ all of them in quotes (e.g.,
<userinput>svn diff --diff-cmd /usr/bin/diff -x
"-b -E"</userinput>).</para>
</listitem>
@@ -364,7 +374,16 @@
option to subcommands that accept log messages.</para>
</listitem>
</varlistentry>
-
+
+ <varlistentry>
+ <term><option>--git</option></term>
+ <listitem>
+ <para>Enables a special output mode for <command>svn
+ diff</command> designed for cross-compatibility with the
+ popular Git distributed version control system.</para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><option>--help</option> (<option>-h</option> or
<option>-?</option>)</term>
@@ -406,6 +425,16 @@
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>--internal-diff</option></term>
+ <listitem>
+ <para>Instructs Subversion to use its built-in
+ differencing engine despite any external differencing
+ mechanism that may be specified for use in the user's
+ runtime configuration.</para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><option>--keep-changelists</option></term>
<listitem>
@@ -656,6 +685,19 @@
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>--show-copies-as-adds</option></term>
+ <listitem>
+ <para>Enables a special output mode for <command>svn
+ diff</command> in which the content difference for a
+ file created via a copy operation appears as it would
+ for a brand new file (with each line therein appearing
+ as an addition to an empty file) rather than as a delta
+ against the original file from which the copy was
+ created.</para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><option>--show-revs</option>
<replaceable>ARG</replaceable></term>
<listitem>
@@ -2107,11 +2149,14 @@
--diff-cmd CMD
--extensions (-x) ARG
--force
+--git
+--internal-diff
--new ARG
--no-diff-deleted
--notice-ancestry
--old ARG
--revision (-r) ARG
+--show-copies-as-adds
--summarize
--xml
</screen>
@@ -2132,6 +2177,7 @@
===================================================================
--- COMMITTERS (revision 4404)
+++ COMMITTERS (working copy)
+…
</screen>
</informalexample>
@@ -2145,6 +2191,7 @@
===================================================================
--- COMMITTERS (revision 3900)
+++ COMMITTERS (working copy)
+…
</screen>
</informalexample>
@@ -2159,6 +2206,7 @@
===================================================================
--- COMMITTERS (revision 3900)
+++ COMMITTERS (working copy)
+…
</screen>
</informalexample>
@@ -2188,6 +2236,7 @@
===================================================================
--- COMMITTERS (revision 3000)
+++ COMMITTERS (revision 3500)
+…
</screen>
</informalexample>
@@ -2223,6 +2272,7 @@
===================================================================
--- COMMITTERS (revision 3000)
+++ COMMITTERS (revision 3500)
+…
</screen>
</informalexample>
@@ -2239,6 +2289,7 @@
0a1,2
> This is a test
>
+$
</screen>
</informalexample>
@@ -2983,7 +3034,12 @@
<informalexample>
<screen>
--change (-c) ARG
+--depth ARG
+--diff
+--diff-cmd ARG
+--extensions (-x) ARG
--incremental
+--internal-diff
--limit (-l) NUM
--quiet (-q)
--revision (-r) REV
@@ -3249,6 +3305,42 @@
</informalexample>
</tip>
+ <para>Beginning with Subversion 1.7, users can take
+ advantage of a special output mode which combines the
+ information from <command>svn log</command> with what you
+ would see when running <command>svn diff</command> on the
+ same targets for each revision of the log. Simply
+ invoke <command>svn log</command> with
+ the <option>--diff</option> option to trigger this output
+ mode.</para>
+
+ <informalexample>
+ <screen>
+$ svn log -r 20 touched.txt --diff
+------------------------------------------------------------------------
+r20 | sally | 2003-01-17 22:56:19 -0600 (Fri, 17 Jan 2003) | 1 line
+
+Made a change.
+
+Index: touched.txt
+===================================================================
+--- touched.txt (revision 19)
++++ touched.txt (revision 20)
+@@ -1 +1,2 @@
+ This is the file 'touched.txt'.
++We add such exciting text to files around here!
+------------------------------------------------------------------------
+$
+</screen>
+ </informalexample>
+
+ <para>As with <command>svn diff</command>, you may also make
+ use of many of the various options which control the way
+ the difference is generated,
+ including <option>--depth</option>,
<option>--diff-cmd</option>,
+ and <option>--extensions</option>
+ (<option>-x</option>).</para>
+
</refsect1>
</refentry>
More information about the svnbook-dev
mailing list