[PATCH] dim: Dumbest base64 parser ever for apply-pull

Daniel Vetter daniel.vetter at ffwll.ch
Fri Dec 14 10:32:49 UTC 2018


Avoids me having to ask patchwork to decode them for me. Worked on the
2 pulls from Dave and Inki I tried it on.

Cc: Dave Airlie <airlied at gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
---
 dim | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/dim b/dim
index 70939ff9abee..0bd9b6c692f0 100755
--- a/dim
+++ b/dim
@@ -999,8 +999,14 @@ function dim_apply_pull
 	from_line=$(grep '^From:' $file)
 
 	if [[ -z "$pull_branch" ]] ; then
-		echoerr "no pull request found"
-		return 1
+		if grep -q "Content-Transfer-Encoding: base64" $file ; then
+			pull_branch=$(sed -e '0,/^$/d' $file | base64 --decode | sed -ne '/[gG]it repository at:$/{n;n;p}')
+		fi
+
+		if [[ -z "$pull_branch" ]] ; then
+			echoerr "no pull request found"
+			return 1
+		fi
 	fi
 
 	message_id=$(message_get_id $file)
-- 
2.20.0.rc1



More information about the dim-tools mailing list