Skip to contentSkip to conversation

dim: update for-next branches as part of nightly rebuild

PATCH In review Jani Nikula 2 participants 8 messages Mar 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 dim: update for-next branches as part of nightly rebuild

Currently the for-linux-next-fixes and for-linux-next branches only get updated after the nightly rebuild after pushing branches. If the nightly rebuild fails at that point, the for-next branches won't get updated until the next time something is pushed, not upon nightly rebuild. Fix this by making for-next branch update part of dim rebuild-nightly.

---
 dim | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
dim +2 -1
index 1e7622a1e902..e3fca75bc5e6 100755
@@ -348,8 +348,10 @@ function dim_rebuild_nightly
 		git push $DRY_RUN origin HEAD >& /dev/null && echo "Done."
 	else
 		echo "Fail: Branch setup for the rerere-cache is borked."
+		exit 1
 	fi
 
+	update_linux_next
 }
 
 function dim_nightly_forget
@@ -378,7 +380,6 @@ function dim_push_branch
 	git push $DRY_RUN $DIM_DRM_INTEL_REMOTE $branch "$@"
 
 	dim_rebuild_nightly
-	update_linux_next
 }
 
 dim_alias_pq=push-queued
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/4 dim: have update-branches also fetch origin and drm upstream repos

Convenient in many cases, but not as intrusive as full remote update.

---
 dim | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
dim +3 -1
index e3fca75bc5e6..a287c9126047 100755
@@ -991,7 +991,9 @@ dim_alias_ub=update-branches
 function dim_update_branches
 {
 	cd $DIM_PREFIX/$DIM_DRM_INTEL
-	git fetch $DIM_DRM_INTEL_REMOTE
+	for remote in $DIM_DRM_INTEL_REMOTE $DIM_DRM_UPSTREAM_REMOTE origin; do
+		git fetch $remote
+	done
 	check_repo_clean $DIM_PREFIX/$DIM_DRM_INTEL Kernel
 
 	for branch in $dim_branches ; do
Signature · 6 lines
2.1.4

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

PATCH 3/4 dim: run checkpatch on committed patches on apply

In reply to Jani Nikula

The input messages may have base64 encoding and whatnot, and checkpatch.pl can't cope with them. Just let 'git am' handle that. The upside is that checkpatch will now catch e.g. duplicate signed-off-bys.

This is a partial revert of

commit a913db697bb063d374229e5e806e514fa44985d0

Author: Daniel Vetter <[email protected]>
Date:   Wed Oct 14 18:32:49 2015 +0200

dim: Store patch in a temp file in apply-patch

although we'll still keep the temp file for other purposes, such as extracting the message-id.

While at it, drop the obsolete check for drm_i915_private_t. We'll now get a build fail for that.

---
 dim | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)
dim +7 -15
index a287c9126047..83cc5161c767 100755
@@ -421,8 +421,6 @@ function dim_apply_branch
 
 	local message_id=$(message_get_id $file)
 
-	shell_checkpatch "cat $file"
-
 	local commiter_email=$(git config --get user.email)
 	local patch_from=$(grep "From:" "$file" | head -1)
 	local sob
@@ -438,6 +436,8 @@ function dim_apply_branch
 		echo "No message-id found in the patch file."
 	fi
 
+	checkpatch_commit HEAD
+
 	eval $DRY $DIM_POST_APPLY_ACTION
 }
 
@@ -686,25 +686,17 @@ function check_repo_clean
 
 }
 
-# $1 is the shell command to display the patch/commit
-function shell_checkpatch
-{
-	local cmd=$1
-
-	$cmd | scripts/checkpatch.pl -q --strict - || true
-	if $cmd | grep '^\+.*\WBUG' > /dev/null; then
-		warn_or_fail "New BUG macro added"
-	fi
-	$cmd | grep '^\+.*drm_i915_private_t' > /dev/null && echo "WARNING: New drm_i915_private_t added" || true
-}
-
 # $1 is the git sha1 to check
 function checkpatch_commit
 {
 	local commit=$1
 
 	git --no-pager log --oneline -1 $commit
-	shell_checkpatch "git show $commit --pretty=email"
+	git show $commit --pretty=email | scripts/checkpatch.pl -q --emacs --strict - || true
+
+	if git show $commit --pretty=email | grep '^\+.*\WBUG' > /dev/null; then
+		warn_or_fail "New BUG macro added"
+	fi
 }
 
 dim_alias_check_patch=checkpatch
Signature · 6 lines
2.1.4

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

Re: [maintainer-tools PATCH 3/4] dim: run checkpatch on committed patches on apply

Quoted 49 lines · Jani Nikula

The input messages may have base64 encoding and whatnot, and checkpatch.pl can't cope with them. Just let 'git am' handle that. The upside is that checkpatch will now catch e.g. duplicate signed-off-bys.

This is a partial revert of

commit a913db697bb063d374229e5e806e514fa44985d0

Author: Daniel Vetter <[email protected]>
Date:   Wed Oct 14 18:32:49 2015 +0200

dim: Store patch in a temp file in apply-patch

although we'll still keep the temp file for other purposes, such as extracting the message-id.

While at it, drop the obsolete check for drm_i915_private_t. We'll now get a build fail for that.

---
 dim | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)
dim +2 -2
index a287c9126047..83cc5161c767 100755
@@ -421,8 +421,6 @@ function dim_apply_branch
 
 	local message_id=$(message_get_id $file)
 
-	shell_checkpatch "cat $file"
-
 	local commiter_email=$(git config --get user.email)
 	local patch_from=$(grep "From:" "$file" | head -1)
 	local sob
@@ -438,6 +436,8 @@ function dim_apply_branch
 		echo "No message-id found in the patch file."
 	fi
 
+	checkpatch_commit HEAD
+
 	eval $DRY $DIM_POST_APPLY_ACTION
 }
 
@@ -686,25 +686,17 @@ function check_repo_clean
 
 }
 

dim function check_repo_clean · line 698

Quoted 10 lines
dim +0 -10
-# $1 is the shell command to display the patch/commit
-function shell_checkpatch
-{
-	local cmd=$1
-
-	$cmd | scripts/checkpatch.pl -q --strict - || true
-	if $cmd | grep '^\+.*\WBUG' > /dev/null; then
-		warn_or_fail "New BUG macro added"
-	fi
-	$cmd | grep '^\+.*drm_i915_private_t' > /dev/null && echo "WARNING: New drm_i915_private_t added" || true

This here seems now lost.
-Daniel

Quoted 24 lines
dim +5 -3
-}
-
 # $1 is the git sha1 to check
 function checkpatch_commit
 {
 	local commit=$1
 
 	git --no-pager log --oneline -1 $commit
-	shell_checkpatch "git show $commit --pretty=email"
+	git show $commit --pretty=email | scripts/checkpatch.pl -q --emacs --strict - || true
+
+	if git show $commit --pretty=email | grep '^\+.*\WBUG' > /dev/null; then
+		warn_or_fail "New BUG macro added"
+	fi
 }
 
 dim_alias_check_patch=checkpatch
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
#4 lore raw

Re: [maintainer-tools PATCH 3/4] dim: run checkpatch on committed patches on apply

On Tue, 15 Mar 2016, Daniel Vetter <[email protected]> wrote:

[snip]

Quoted 2 lines
Quoted 2 lines

While at it, drop the obsolete check for drm_i915_private_t. We'll now get a build fail for that.

[snip]

Quoted 3 lines

dim function check_repo_clean · line 698

Quoted 1 line
dim +0 -1
-	$cmd | grep '^\+.*drm_i915_private_t' > /dev/null && echo "WARNING: New drm_i915_private_t added" || true

This here seems now lost.

Yes. Who needs it now that we don't have the typedef anymore?

BR,
Jani.

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

Re: [maintainer-tools PATCH 3/4] dim: run checkpatch on committed patches on apply

Quoted 7 lines · Jani Nikula

On Tue, 15 Mar 2016, Daniel Vetter <[email protected]> wrote:

[snip]

Quoted 2 lines
Quoted 2 lines

While at it, drop the obsolete check for drm_i915_private_t. We'll now get a build fail for that.

Quoted 7 lines

[snip]

Quoted 3 lines

dim function check_repo_clean · line 698

Quoted 1 line
dim +0 -1
-	$cmd | grep '^\+.*drm_i915_private_t' > /dev/null && echo "WARNING: New drm_i915_private_t added" || true

This here seems now lost.

Yes. Who needs it now that we don't have the typedef anymore?

Hah, silly me, didn't realized we managed to nuke it ;-) r-b on everything as-is.
-Daniel

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
#6 lore raw

PATCH 4/4 dim: unify repo clean checks to a single assert_repo_clean helper

In reply to Jani Nikula

Moreover, 'git diff-index --quiet HEAD' kept failing on me even though the repo was clean (merely running 'git status' always fixed this). So use the other one.

---
 dim | 27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)
dim +11 -16
index 83cc5161c767..9c8ae1098977 100755
@@ -411,11 +411,7 @@ function dim_apply_branch
 	local file=`mktemp`
 
 	assert_branch $branch
-
-	if [[ -n `git status --porcelain --untracked-files=no` ]] ; then
-		echo Repository not clean, aborting
-		exit 2
-	fi
+	assert_repo_clean
 
 	cat > $file
 
@@ -676,16 +672,6 @@ function dim_conf
 	dim_checkout drm-intel-next-fixes "$@"
 }
 
-function check_repo_clean
-{
-	cd $1
-	if ! git diff-index --quiet HEAD ; then
-		echo $2 repo not clean, aborting
-		exit 1
-	fi
-
-}
-
 # $1 is the git sha1 to check
 function checkpatch_commit
 {
@@ -986,7 +972,8 @@ function dim_update_branches
 	for remote in $DIM_DRM_INTEL_REMOTE $DIM_DRM_UPSTREAM_REMOTE origin; do
 		git fetch $remote
 	done
-	check_repo_clean $DIM_PREFIX/$DIM_DRM_INTEL Kernel
+
+	assert_repo_clean
 
 	for branch in $dim_branches ; do
 		dim_checkout $branch
@@ -1110,6 +1097,14 @@ function assert_branch
 	fi
 }
 
+function assert_repo_clean
+{
+	if [[ -n "$(git status --porcelain --untracked-files=no)" ]]; then
+		echo "Repository not clean, aborting."
+		exit 1
+	fi
+}
+
 # Note: used by bash completion
 function dim_list_commands
 {
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 4/4
#7 lore raw

Re: [maintainer-tools PATCH 4/4] dim: unify repo clean checks to a single assert_repo_clean helper

Quoted 5 lines · Jani Nikula

Moreover, 'git diff-index --quiet HEAD' kept failing on me even though the repo was clean (merely running 'git status' always fixed this). So use the other one.

Oh nice find, never figured out that one really. One nitpick on patch 3, with that addressed on the entire series:

Quoted 70 lines
---
 dim | 27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)
dim +11 -16
index 83cc5161c767..9c8ae1098977 100755
@@ -411,11 +411,7 @@ function dim_apply_branch
 	local file=`mktemp`
 
 	assert_branch $branch
-
-	if [[ -n `git status --porcelain --untracked-files=no` ]] ; then
-		echo Repository not clean, aborting
-		exit 2
-	fi
+	assert_repo_clean
 
 	cat > $file
 
@@ -676,16 +672,6 @@ function dim_conf
 	dim_checkout drm-intel-next-fixes "$@"
 }
 
-function check_repo_clean
-{
-	cd $1
-	if ! git diff-index --quiet HEAD ; then
-		echo $2 repo not clean, aborting
-		exit 1
-	fi
-
-}
-
 # $1 is the git sha1 to check
 function checkpatch_commit
 {
@@ -986,7 +972,8 @@ function dim_update_branches
 	for remote in $DIM_DRM_INTEL_REMOTE $DIM_DRM_UPSTREAM_REMOTE origin; do
 		git fetch $remote
 	done
-	check_repo_clean $DIM_PREFIX/$DIM_DRM_INTEL Kernel
+
+	assert_repo_clean
 
 	for branch in $dim_branches ; do
 		dim_checkout $branch
@@ -1110,6 +1097,14 @@ function assert_branch
 	fi
 }
 
+function assert_repo_clean
+{
+	if [[ -n "$(git status --porcelain --untracked-files=no)" ]]; then
+		echo "Repository not clean, aborting."
+		exit 1
+	fi
+}
+
 # Note: used by bash completion
 function dim_list_commands
 {
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