Skip to contentSkip to conversation

dim: abstract git commit range expansion helper

PATCH In review Jani Nikula 2 participants 3 messages Mar 16, 2016 – Mar 21, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 dim: abstract git commit range expansion helper

---
 dim | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
dim +12 -8
index 67671de198a0..65985bc4909a 100755
@@ -690,19 +690,23 @@ function checkpatch_commit
 	fi
 }
 
-dim_alias_check_patch=checkpatch
-dim_alias_cp=checkpatch
-function dim_checkpatch
+# turn $1 in to a git commit range
+function rangeish()
 {
-	local range
-
 	if [ -z "$1" ]; then
-		range="HEAD^..HEAD"
+		echo "HEAD^..HEAD"
 	elif [ -n "`echo $1 | grep '\.\.'`" ]; then
-		range="$1"
+		echo "$1"
 	else
-		range="$1..HEAD"
+		echo "$1..HEAD"
 	fi
+}
+
+dim_alias_check_patch=checkpatch
+dim_alias_cp=checkpatch
+function dim_checkpatch
+{
+	local range=$(rangeish "$1")
 
 	for commit in $(git rev-list --reverse $range); do
 		checkpatch_commit $commit || true
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 2/2 dim: add dim sparse subcommand to run sparse on a commit range

Run sparse only on files that have changed in the range. Replace dim checker with the new one.

---
 dim | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
dim +7 -4
index 65985bc4909a..61745b556517 100755
@@ -713,11 +713,14 @@ function dim_checkpatch
 	done
 }
 
-function dim_checker
+dim_alias_checker=sparse
+function dim_sparse
 {
-	rm drivers/gpu/drm/i915/*.o &> /dev/null || true
-	rm drivers/gpu/drm/i915/*.ko &> /dev/null || true
-	make C=1 drivers/gpu/drm/i915/i915.ko
+	local range=$(rangeish "$1")
+
+	make -j5
+	touch --no-create `git diff --name-only $range` `git diff --name-only`
+	make C=1
 }
 
 function prep_pull_mail_greetings
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

Re: [maintainer-tools PATCH 2/2] dim: add dim sparse subcommand to run sparse on a commit range

Quoted 4 lines · Jani Nikula

Run sparse only on files that have changed in the range. Replace dim checker with the new one.

Need to update the help to align with check-patch. And maybe move them together. And perhaps rename the command to sparse-patch or something, or check-sparse or whatever, for a bit more consistency in these.

With that bikeshed address, ack on both.
-Daniel

Quoted 34 lines
---
 dim | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
dim +7 -4
index 65985bc4909a..61745b556517 100755
@@ -713,11 +713,14 @@ function dim_checkpatch
 	done
 }
 
-function dim_checker
+dim_alias_checker=sparse
+function dim_sparse
 {
-	rm drivers/gpu/drm/i915/*.o &> /dev/null || true
-	rm drivers/gpu/drm/i915/*.ko &> /dev/null || true
-	make C=1 drivers/gpu/drm/i915/i915.ko
+	local range=$(rangeish "$1")
+
+	make -j5
+	touch --no-create `git diff --name-only $range` `git diff --name-only`
+	make C=1
 }
 
 function prep_pull_mail_greetings
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx