[maintainer-tools PATCH 2/4] dim: Fix shellcheck SC2162 and SC2166

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fixes: 809748225c4e ("dim: Add add-missing-cc command")
Cc: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>
Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
---
 dim | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/dim b/dim
index 28a137221535..070b199c699b 100755
--- a/dim
+++ b/dim
@@ -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" = "dri-devel@xxxxxxxxxxxxxxxxxxxxx" -o \
-		     "$email" = "linux-kernel@xxxxxxxxxxxxxxx}" ]; then
+		if [[ "$email" = "dri-devel@xxxxxxxxxxxxxxxxxxxxx" || \
+		      "$email" = "linux-kernel@xxxxxxxxxxxxxxx}" ]]; 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
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux