Skip to contentSkip to conversation

dim: shellcheck fixes

PATCH In review Jani Nikula 2 participants 7 messages Aug 10, 2017 – Aug 11, 2017

lore
Share & tools
lore
#0 lore raw

cover dim: shellcheck fixes

Thou shalt not push dim patches before passing 'make check'.

Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Benjamin Gaignard <[email protected]>

Jani Nikula (4):
dim: Fix shellcheck SC1083
dim: Fix shellcheck SC2162 and SC2166
dim: Fix shellcheck SC2153
dim: Fix shellcheck SC2053

 dim | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
Signature · 6 lines
2.11.0

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

PATCH 1/4 dim: Fix shellcheck SC1083

Fixes 7968b1c836f6 ("dim: Enforce review requirements")
Cc Daniel Vetter <[email protected]>
---
 dim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dim +1 -1
index f576fca0488a..28a137221535 100755
@@ -707,7 +707,7 @@ function dim_push_branch
 
 	committer_email=$(git_committer_email)
 
-	for sha1 in $(git rev-list $branch@{u}..$branch --committer="$committer_email" --no-merges) ; do
+	for sha1 in $(git rev-list "$branch@{u}..$branch" --committer="$committer_email" --no-merges) ; do
 		checkpatch_commit_push $sha1
 	done
 
Signature · 6 lines
2.11.0

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

PATCH 2/4 dim: Fix shellcheck SC2162 and SC2166

In reply to Jani Nikula
Fixes 809748225c4e ("dim: Add add-missing-cc command")
Cc Maarten Lankhorst <[email protected]>
---
 dim | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
dim +6 -4
index 28a137221535..070b199c699b 100755
@@ -1959,7 +1959,9 @@ function dim_fixes
 
 function dim_add_missing_cc
 {
-	git show | scripts/get_maintainer.pl --email --norolestats --pattern-depth 1 | while read cc; do
+	local email name matches
+
+	git show | scripts/get_maintainer.pl --email --norolestats --pattern-depth 1 | while read -r cc; do
 		email="$(echo "$cc" | sed -e 's/.*<//' -e 's/>.*//')"
 		name=''
 
@@ -1968,15 +1970,15 @@ function dim_add_missing_cc
 		fi
 
 		# Don't add main mailing lists
-		if [ "$email" = "[email protected]" -o \
-		     "$email" = "[email protected]}" ]; then
+		if [[ "$email" = "[email protected]" || \
+		      "$email" = "[email protected]}" ]]; then
 			continue
 		fi
 
 		# Variables from the while loop don't propagate,
 		# print out a 1 on success
 		matches=$(
-			git show -s | grep -i "^    Cc:" | sed 's/^ *[Cc][Cc]: *//' | while read testcc; do
+			git show -s | grep -i "^    Cc:" | sed 's/^ *[Cc][Cc]: *//' | while read -r testcc; do
 				testemail="$(echo "$testcc" | sed -e 's/.*<//' -e 's/>.*//')"
 
 				if [ "$testemail" != "$email" ]; then
Signature · 6 lines
2.11.0

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

PATCH 3/4 dim: Fix shellcheck SC2153

In reply to Jani Nikula

The fix is a bit artificial, but mute the warning.

Fixes 809748225c4e ("dim: Add add-missing-cc command")
Cc Maarten Lankhorst <[email protected]>
---
 dim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dim +1 -1
index 070b199c699b..f614533c5b09 100755
@@ -350,7 +350,7 @@ function git_branch_exists # branch
 function git_committer_email
 {
 	if ! committer_email=$(git config --get user.email) ; then
-		committer_email=$EMAIL
+		committer_email=${EMAIL-}
 	fi
 
 	echo $committer_email
Signature · 6 lines
2.11.0

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

PATCH 4/4 dim: Fix shellcheck SC2053

In reply to Jani Nikula
Fixes 3cb0514bf1ca ("dim: add checks for author and committer sign-off-by")
Cc Benjamin Gaignard <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 dim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dim +1 -1
index f614533c5b09..2b377cb3a3f3 100755
@@ -685,7 +685,7 @@ function checkpatch_commit_push
 	fi
 
 	# check for committer != author
-	if [[ $committer  != $author ]]; then
+	if [[ "$committer" != "$author" ]]; then
 		return
 	fi
 
Signature · 6 lines
2.11.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on the v1 series
#5 lore raw
In reply to Jani Nikula
Quoted 1 line · Jani Nikula

Thou shalt not push dim patches before passing 'make check'.

On the series:

Quoted 18 lines
Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Benjamin Gaignard <[email protected]>

Jani Nikula (4):
dim: Fix shellcheck SC1083
dim: Fix shellcheck SC2162 and SC2166
dim: Fix shellcheck SC2153
dim: Fix shellcheck SC2053

 dim | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
Signature · 1 line
2.11.0
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
Quoted 6 lines · Daniel Vetter
Quoted 1 line · Jani Nikula

Thou shalt not push dim patches before passing 'make check'.

On the series:

Thanks, pushed.

BR,
Jani.

Quoted 19 lines
Quoted 19 lines
Cc Daniel Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Benjamin Gaignard <[email protected]>

Jani Nikula (4):
dim: Fix shellcheck SC1083
dim: Fix shellcheck SC2162 and SC2166
dim: Fix shellcheck SC2153
dim: Fix shellcheck SC2053

 dim | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
Signature · 1 line
2.11.0
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx