From a2acdb3dd27b65212eb6aa05af47b8200bdf751f Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 10 Jan 2013 17:39:04 -0700 Subject: [PATCH] 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. --- HACKING | 11 +++++++++-- docs/hacking.html.in | 12 +++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/HACKING b/HACKING index af27fbea65..bf02b65076 100644 --- a/HACKING +++ b/HACKING @@ -14,7 +14,12 @@ General tips for contributing patches (1) Discuss any large changes on the mailing list first. Post patches early and 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 @@ -22,7 +27,9 @@ or: 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 pull diff --git a/docs/hacking.html.in b/docs/hacking.html.in index 97624e53bb..6485676b23 100644 --- a/docs/hacking.html.in +++ b/docs/hacking.html.in @@ -9,8 +9,12 @@
  • Discuss any large changes on the mailing list first. Post patches early and listen to feedback.
  • -
  • Post patches in unified diff format. A command similar to this - should work:

    +
  • 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
     
    @@ -20,7 +24,9 @@
       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 pull