[Avocado-devel] Fwd: [Qemu-devel] [PATCH v2] scripts: add "git.orderfile" for ordering diff hunks by pathname patterns

Ademar Reis areis at redhat.com
Sat Dec 3 21:36:22 UTC 2016


FYI, follow-up to the discussion about git.orderFile. This patch
is likely to be merged in QEMU. The discussion that lead to this
patch can be found here:

https://lists.gnu.org/archive/html/qemu-devel/2016-11/msg05339.html
https://lists.gnu.org/archive/html/qemu-devel/2016-12/msg00221.html
https://lists.gnu.org/archive/html/qemu-devel/2016-12/msg00224.html

My guess is that this setting does affect github and (our version of
this change) is worth adding to our git repositories.

Thanks.
   - Ademar

----- Forwarded message from Laszlo Ersek <lersek at redhat.com> -----

Date: Fri,  2 Dec 2016 22:01:52 +0100
From: Laszlo Ersek <lersek at redhat.com>
Subject: [Qemu-devel] [PATCH v2] scripts: add "git.orderfile" for ordering diff hunks by pathname patterns
To: qemu devel list <qemu-devel at nongnu.org>
Cc: Fam Zheng <famz at redhat.com>, "Michael S. Tsirkin" <mst at redhat.com>, Max Reitz <mreitz at redhat.com>, Gerd Hoffmann <kraxel at redhat.com>,
	Stefan Hajnoczi <stefanha at gmail.com>, John Snow <jsnow at redhat.com>

When passed to git-diff (and to every other git command producing diffs
and/or diffstats) with "-O" or "diff.orderFile", this list of patterns
will place the more declarative / abstract hunks first, while changes to
imperative code / details will be near the end of the patches. This saves
on scrolling / searching and makes for easier reviewing.

We intend to advise contributors in the Wiki to run

  git config diff.orderFile scripts/git.orderfile

once, as part of their initial setup, before formatting their first (or,
for repeat contributors, next) patches.

See the "-O" option and the "diff.orderFile" configuration variable in
git-diff(1) and git-config(1).

Cc: "Michael S. Tsirkin" <mst at redhat.com>
Cc: Eric Blake <eblake at redhat.com>
Cc: Fam Zheng <famz at redhat.com>
Cc: Gerd Hoffmann <kraxel at redhat.com>
Cc: John Snow <jsnow at redhat.com>
Cc: Max Reitz <mreitz at redhat.com>
Cc: Stefan Hajnoczi <stefanha at gmail.com>
Signed-off-by: Laszlo Ersek <lersek at redhat.com>
---

Notes:
    v2:
    - "Makefile" -> "Makefile*" [Gerd]
    - add leading comment [Gerd]
    - add "docs/*" (note, there are *.txt files outside of docs/, so keeping
      those too) [Max, Fam, Eric]

 scripts/git.orderfile | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 scripts/git.orderfile

diff --git a/scripts/git.orderfile b/scripts/git.orderfile
new file mode 100644
index 000000000000..3cab16e0505c
--- /dev/null
+++ b/scripts/git.orderfile
@@ -0,0 +1,20 @@
+# Apply this diff order to your git configuration with the command
+#
+#   git config diff.orderFile scripts/git.orderfile
+
+docs/*
+*.txt
+configure
+GNUmakefile
+makefile
+Makefile*
+*.mak
+qapi-schema*.json
+qapi/*.json
+include/qapi/visitor.h
+include/qapi/visitor-impl.h
+scripts/qapi.py
+scripts/*.py
+*.h
+qapi/qapi-visit-core.c
+*.c
-- 
2.9.2



----- End forwarded message -----

-- 
Ademar Reis
Red Hat

^[:wq!




More information about the Avocado-devel mailing list