Fix example of using diff, mention when to use unified vs. context
formats. Submitted by: jhb
This commit is contained in:
parent
945551a07c
commit
a6a041f2af
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=13751
1 changed files with 23 additions and 6 deletions
|
|
@ -315,22 +315,39 @@ FreeBSD Entities//EN"> %freebsd;
|
|||
<para>Assuming that you can manage to secure fairly up-to-date sources
|
||||
to base your changes on, the next step is to produce a set of diffs to
|
||||
send to the FreeBSD maintainers. This is done with the &man.diff.1;
|
||||
command, with the <quote>unified diff</quote> form
|
||||
being preferred. For example:</para>
|
||||
command.</para>
|
||||
|
||||
<para>The preferred &man.diff.1; format for submitting patches
|
||||
is the unified output format generated by <command>diff
|
||||
-u</command>. However, for patches that substantially change a
|
||||
region of code, a context output format diff generated by
|
||||
<command>diff -c</command> may be more readable and thus
|
||||
preferable.</para>
|
||||
|
||||
<indexterm>
|
||||
<primary><command>diff</command></primary>
|
||||
</indexterm>
|
||||
|
||||
<para>For example:</para>
|
||||
|
||||
<para>
|
||||
<screen>&prompt.user; <userinput>diff -u -c oldfile newfile</userinput></screen>
|
||||
<screen>&prompt.user; <userinput>diff -c oldfile newfile</userinput></screen>
|
||||
|
||||
or
|
||||
|
||||
<screen>&prompt.user; <userinput>diff -u -c -r olddir newdir</userinput></screen>
|
||||
<screen>&prompt.user; <userinput>diff -c -r olddir newdir</userinput></screen>
|
||||
|
||||
would generate such a set of context diffs for the given
|
||||
source file or directory hierarchy. See the manual page for
|
||||
&man.diff.1; for more details.</para>
|
||||
source file or directory hierarchy.</para>
|
||||
|
||||
<para>Likewise,
|
||||
<screen>&prompt.user; <userinput>diff -u oldfile newfile</userinput></screen>
|
||||
or
|
||||
<screen>&prompt.user; <userinput>diff -u -r olddir newdir</userinput></screen>
|
||||
|
||||
would do the same, except in the unified diff format.</para>
|
||||
|
||||
<para>See the manual page for &man.diff.1; for more details.</para>
|
||||
|
||||
<para>Once you have a set of diffs (which you may test with the
|
||||
&man.patch.1; command), you should submit them for inclusion
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue