<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../general.ent">
  %general-entities;
]>

<sect1 id="ch03-diff">
  <title>svn diff/di</title>
  <?dbhtml filename="diff.html"?>

  <para><userinput>svn diff</userinput>, or <userinput>svn di</userinput>.
    This is useful for three different purposes.
  </para>

  <para>Firstly, those without write access to the LFS Subversion server can use it to
    generate patches to send to <email>lfs-dev@linuxfromscratch.org</email>. To do this,
    simply edit the files in your local working copy then run
    <userinput>svn diff &gt; FILE.patch</userinput> from the root of your LFS
    directory. You can then attach this file to a message to the
    <userinput>lfs-dev</userinput> list where editors can review the patch and
    apply it to the book.
  </para>

  <para>The second use is to find out what has changed between two revisions of
    a file by running:
  </para>

  <para><screen><userinput>svn diff -r revision1:revision2 FILENAME</userinput></screen></para>

  <para>For example: <userinput>svn diff -r 99:100 index.xml</userinput>
    will output a diff showing the changes between revisions 99 and
    100 of <filename>index.xml</filename>.
  </para>

  <para>A third use is to recursively request all the changes between your working
    copy and the copy on the Subversion server. This is handy to do before running
    <userinput>svn update</userinput> to see what exactly has changed since the
    last time you ran the update command.
  </para>
</sect1>
