docs: mention git rename detection

I've noticed a number of people sending patches with file
renames not compressed, so we might as well document how to
set this up.  (Git won't do it by default, for back-compat
reasons)

* docs/hacking.html.in: Add git config tip.
* HACKING: Regenerate.
This commit is contained in:
Eric Blake 2013-01-10 17:39:04 -07:00
parent ed4bbe6bc4
commit a2acdb3dd2
2 changed files with 18 additions and 5 deletions

11
HACKING
View File

@ -14,7 +14,12 @@ General tips for contributing patches
(1) Discuss any large changes on the mailing list first. Post patches early and (1) Discuss any large changes on the mailing list first. Post patches early and
listen to feedback. listen to feedback.
(2) Post patches in unified diff format. A command similar to this should work: (2) Post patches in unified diff format, with git rename detection enabled. You
need a one-time setup of:
git config diff.renames true
After that, a command similar to this should work:
diff -urp libvirt.orig/ libvirt.modified/ > libvirt-myfeature.patch diff -urp libvirt.orig/ libvirt.modified/ > libvirt-myfeature.patch
@ -22,7 +27,9 @@ or:
git diff > libvirt-myfeature.patch git diff > libvirt-myfeature.patch
However, the usual workflow of libvirt developer is: Also, for code motion patches, you may find that "git diff --patience"
provides an easier-to-read patch. However, the usual workflow of libvirt
developer is:
git checkout master git checkout master
git pull git pull

View File

@ -9,8 +9,12 @@
<li>Discuss any large changes on the mailing list first. Post patches <li>Discuss any large changes on the mailing list first. Post patches
early and listen to feedback.</li> early and listen to feedback.</li>
<li><p>Post patches in unified diff format. A command similar to this <li><p>Post patches in unified diff format, with git rename
should work:</p> detection enabled. You need a one-time setup of:</p>
<pre>
git config diff.renames true
</pre>
<p>After that, a command similar to this should work:</p>
<pre> <pre>
diff -urp libvirt.orig/ libvirt.modified/ &gt; libvirt-myfeature.patch diff -urp libvirt.orig/ libvirt.modified/ &gt; libvirt-myfeature.patch
</pre> </pre>
@ -20,7 +24,9 @@
<pre> <pre>
git diff &gt; libvirt-myfeature.patch git diff &gt; libvirt-myfeature.patch
</pre> </pre>
<p>However, the usual workflow of libvirt developer is:</p> <p>Also, for code motion patches, you may find that <code>git
diff --patience</code> provides an easier-to-read patch.
However, the usual workflow of libvirt developer is:</p>
<pre> <pre>
git checkout master git checkout master
git pull git pull