Skip to contentSkip to conversation

Add git-diff orderFile

PATCH Applied Andrew Jones 3 participants 3 messages Dec 12, 2016 – Jan 12, 2017 KVM

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Add git-diff orderFile

It's helpful to have a common order of file types in patches. Applying git-diff's orderFile feature allows us to do that. Just do 'git config diff.orderFile scripts/git.difforder' to enable it.

---
v2 changed the file name and forces common (lib/) before unit
test code. Rearranged some other stuff too; now the approach is docs, running, building, common-lib/arch-lib (can't force common-lib to be first), unit-test, unittests.cfg, and, as much as possible, helpers before users and headers before code.

---
 README                |  6 ++++++
 scripts/git.difforder | 25 +++++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100644 scripts/git.difforder
README +6 -0
index f8f196d90bf1..3240b952f97c 100644
@@ -66,3 +66,9 @@ You can add the following to .git/config to do this automatically for you:
 [format]
 	subjectprefix = kvm-unit-tests PATCH
 
+Additionally it's helpful to have a common order of file types in patches.
+Our chosen order attempts to place the more declarative files before
+the code files. We also start with common code and finish with unit test
+code. git-diff's orderFile feature allows us to specify the order in a
+file. The orderFile we use is scripts/git.difforder. Adding the config
+with 'git config diff.orderFile scripts/git.difforder' enables it.
scripts/git.difforder new file +25 -0
new file mode 100644
index 000000000000..ef493220831d
@@ -0,0 +1,25 @@
+COPYRIGHT
+MAINTAINERS
+*README
+scripts/*.mak
+scripts/*.py
+scripts/*.bash
+scripts/*.sh
+scripts/*
+*/run
+run_tests.sh
+configure
+*Makefile*
+*.mak
+lib/*.lds
+lib/linux/*
+lib/asm-generic/*
+lib/*/asm/*
+lib/*.h
+lib/*.S
+lib/*.c
+*.lds
+*.h
+*.S
+*.c
+*.cfg
Signature · 1 line
2.9.3
Acked-by on v2 1/1
#1 lore raw

2016-12-12 15:08+0100, Andrew Jones:

Quoted 11 lines

It's helpful to have a common order of file types in patches. Applying git-diff's orderFile feature allows us to do that. Just do 'git config diff.orderFile scripts/git.difforder' to enable it.

---
v2 changed the file name and forces common (lib/) before unit
test code. Rearranged some other stuff too; now the approach is docs, running, building, common-lib/arch-lib (can't force common-lib to be first), unit-test, unittests.cfg, and, as much as possible, helpers before users and headers before code.

(While burning the pile of review notes I prepared for v2 through v9;
v9 would ask for a checkpatch script to verify the order. ;])

maintainer Applied
#2 lore raw
Quoted 13 lines · Radim Krčmář

2016-12-12 15:08+0100, Andrew Jones:

Quoted 11 lines

It's helpful to have a common order of file types in patches. Applying git-diff's orderFile feature allows us to do that. Just do 'git config diff.orderFile scripts/git.difforder' to enable it.

---
v2 changed the file name and forces common (lib/) before unit
test code. Rearranged some other stuff too; now the approach is docs, running, building, common-lib/arch-lib (can't force common-lib to be first), unit-test, unittests.cfg, and, as much as possible, helpers before users and headers before code.

Quoted 5 lines

(While burning the pile of review notes I prepared for v2 through v9;
v9 would ask for a checkpatch script to verify the order. ;])

Applied, thanks.

Paolo