Skip to contentSkip to conversation

Add git.orderFile

PATCH Superseded Andrew Jones 2 participants 3 messages Dec 8, 2016 – Dec 9, 2016 KVM

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add git.orderFile

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

---
This was inspired by Laszlo's patch for QEMU. Anyway it's high time somebody posts some good kvm-unit-tests bikeshedding bait!

---
 README                |  4 ++++
 scripts/git.orderfile | 15 +++++++++++++++
 2 files changed, 19 insertions(+)
 create mode 100644 scripts/git.orderfile
README +4 -0
index f8f196d90bf1..73fdd526aed7 100644
@@ -66,3 +66,7 @@ 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 standard sequence of file types in
+patches. Applying git-diff's orderFile feature allows us to do that.
+The orderFile we use is scripts/git.orderfile. Adding the diff.orderFile
+config (git config diff.orderFile scripts/git.orderfile) will enable it.
scripts/git.orderfile new file +15 -0
new file mode 100644
index 000000000000..b98a0e78a37e
@@ -0,0 +1,15 @@
+COPYRIGHT
+MAINTAINERS
+*README
+configure
+*Makefile*
+*.mak
+*.py
+*.bash
+*/run
+*.sh
+*.cfg
+*.lds
+*.h
+*.S
+*.c
Signature · 1 line
2.9.3
#1 lore raw

2016-12-08 16:39+0100, Andrew Jones:

Quoted 8 lines

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

---
This was inspired by Laszlo's patch for QEMU. Anyway it's high time somebody posts some good kvm-unit-tests bikeshedding bait!

I raise 10 hours of our lives!

Quoted 11 lines
---
 README                |  4 ++++
 scripts/git.orderfile | 15 +++++++++++++++
 2 files changed, 19 insertions(+)
 create mode 100644 scripts/git.orderfile
README +0 -0
index f8f196d90bf1..73fdd526aed7 100644

README You can add the following to .git/config to do this automatically for you: · line 70

Quoted 5 lines
README +2 -0
@@ -66,3 +66,7 @@ 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 standard sequence of file types in
+patches. Applying git-diff's orderFile feature allows us to do that.

We already have a standard sequence -- alphabetic order. ;)

I assume the goal is to move the abstract parts to the top of the patch and minute detail to the bottom, allowing reviewers to understand few more things on the first read.

README You can add the following to .git/config to do this automatically for you: · line 72

Quoted 2 lines
README +2 -0
+The orderFile we use is scripts/git.orderfile. Adding the diff.orderFile
+config (git config diff.orderFile scripts/git.orderfile) will enable it.

The only thing we don't want to be changing afterwards is the file path.

What about scripts/git.order?
The file suffix is pretty obvious and other similar git files don't use file suffix. e.g. core.excludeFile -> .gitignore and core.attributesFile -> .gitattributes.

Quoted 11 lines
scripts/git.orderfile new file +5 -0
new file mode 100644
index 000000000000..b98a0e78a37e
@@ -0,0 +1,15 @@
+COPYRIGHT
+MAINTAINERS
+*README
+configure
+*Makefile*

scripts/git.orderfile line 15

Quoted 10 lines
scripts/git.orderfile new file +10 -0
+*.mak
+*.py
+*.bash
+*/run
+*.sh
+*.cfg
+*.lds
+*.h
+*.S
+*.c

Let's treat lib/ specially, so the lib/ <-> $arch/ order of hunks remains the same on all arches.

Whew, this bikeshedding stuff is good ... I plan to apply on Monday, to let other people have some fun as well.

Thanks.

#2 lore raw
Quoted 26 lines · Radim Krčmář

2016-12-08 16:39+0100, Andrew Jones:

Quoted 8 lines

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

---
This was inspired by Laszlo's patch for QEMU. Anyway it's high time somebody posts some good kvm-unit-tests bikeshedding bait!

I raise 10 hours of our lives!

Quoted 14 lines
---
 README                |  4 ++++
 scripts/git.orderfile | 15 +++++++++++++++
 2 files changed, 19 insertions(+)
 create mode 100644 scripts/git.orderfile
README +0 -0
index f8f196d90bf1..73fdd526aed7 100644
@@ -66,3 +66,7 @@ You can add the following to .git/config to do this automatically for you:
 [format]
 	subjectprefix = kvm-unit-tests PATCH
 
Quoted 4 lines

README You can add the following to .git/config to do this automatically for you: · line 70

Quoted 2 lines
README +2 -0
+Additionally it's helpful to have a standard sequence of file types in
+patches. Applying git-diff's orderFile feature allows us to do that.

We already have a standard sequence -- alphabetic order. ;)

Well, unless people use their own random orderFiles, but yeah, I should have worded that differently.

Quoted 4 lines

I assume the goal is to move the abstract parts to the top of the patch and minute detail to the bottom, allowing reviewers to understand few more things on the first read.

Right. I should have stolen more than the idea from Laszlo, I should have also stolen some of his text too "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."

Quoted 10 lines

README You can add the following to .git/config to do this automatically for you: · line 72

Quoted 3 lines
README +2 -0
+The orderFile we use is scripts/git.orderfile. Adding the diff.orderFile
+config (git config diff.orderFile scripts/git.orderfile) will enable it.

The only thing we don't want to be changing afterwards is the file path.

What about scripts/git.order?
The file suffix is pretty obvious and other similar git files don't use file suffix. e.g. core.excludeFile -> .gitignore and core.attributesFile -> .gitattributes.

Works for me, however I did steal the filename from Laszlo's QEMU patch, so, FWIW, scripts/git.orderfile is consistent with QEMU. If we don't want the QEMU name, then I propose git.difforder.

Quoted 17 lines
Quoted 17 lines
scripts/git.orderfile new file +10 -0
new file mode 100644
index 000000000000..b98a0e78a37e
@@ -0,0 +1,15 @@
+COPYRIGHT
+MAINTAINERS
+*README
+configure
+*Makefile*
+*.mak
+*.py
+*.bash
+*/run
+*.sh
Quoted 8 lines

scripts/git.orderfile line 15

Quoted 5 lines
scripts/git.orderfile new file +5 -0
+*.cfg
+*.lds
+*.h
+*.S
+*.c

Let's treat lib/ specially, so the lib/ <-> $arch/ order of hunks remains the same on all arches.

That's a good idea. I should have put lib/ above $arch/ to ensure we see the common code additions before their use when reviewing.

Quoted 3 lines

Whew, this bikeshedding stuff is good ... I plan to apply on Monday, to let other people have some fun as well.

I hope you saved some comments for v2!

Thanks,
drew

Quoted 6 lines

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html