public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH kvm-unit-tests v2] Add git-diff orderFile
@ 2016-12-12 14:08 Andrew Jones
  2016-12-13 16:06 ` Radim Krčmář
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Jones @ 2016-12-12 14:08 UTC (permalink / raw)
  To: kvm; +Cc: rkrcmar, pbonzini, lvivier, thuth

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.

Signed-off-by: Andrew Jones <drjones@redhat.com>
---
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

diff --git a/README b/README
index f8f196d90bf1..3240b952f97c 100644
--- a/README
+++ b/README
@@ -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.
diff --git a/scripts/git.difforder b/scripts/git.difforder
new file mode 100644
index 000000000000..ef493220831d
--- /dev/null
+++ b/scripts/git.difforder
@@ -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
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH kvm-unit-tests v2] Add git-diff orderFile
  2016-12-12 14:08 [PATCH kvm-unit-tests v2] Add git-diff orderFile Andrew Jones
@ 2016-12-13 16:06 ` Radim Krčmář
  2017-01-12 12:16   ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Radim Krčmář @ 2016-12-13 16:06 UTC (permalink / raw)
  To: Andrew Jones; +Cc: kvm, pbonzini, lvivier, thuth

2016-12-12 15:08+0100, Andrew Jones:
> 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.
> 
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> ---
> 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.

Acked-by: Radim Krčmář <rkrcmar@redhat.com>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH kvm-unit-tests v2] Add git-diff orderFile
  2016-12-13 16:06 ` Radim Krčmář
@ 2017-01-12 12:16   ` Paolo Bonzini
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2017-01-12 12:16 UTC (permalink / raw)
  To: Radim Krčmář, Andrew Jones; +Cc: kvm, lvivier, thuth



On 13/12/2016 17:06, Radim Krčmář wrote:
> 2016-12-12 15:08+0100, Andrew Jones:
>> 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.
>>
>> Signed-off-by: Andrew Jones <drjones@redhat.com>
>> ---
>> 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.
> 
> Acked-by: Radim Krčmář <rkrcmar@redhat.com>
> 
> (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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-12 12:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-12 14:08 [PATCH kvm-unit-tests v2] Add git-diff orderFile Andrew Jones
2016-12-13 16:06 ` Radim Krčmář
2017-01-12 12:16   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox