[PATCH] dim: Try harder to parse pull request lines

Daniel Vetter daniel.vetter at ffwll.ch
Tue Feb 19 09:58:01 UTC 2019


Sometimes they get split, and then we lose the branch, pulling the
default branch.

Cc: Maxime Ripard <maxime.ripard at bootlin.com>
Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
---
 dim | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dim b/dim
index 10f823283b55..06188fea94c6 100755
--- a/dim
+++ b/dim
@@ -1089,7 +1089,10 @@ function dim_apply_pull
 
 	cat > $file
 
-	pull_branch=$(message_print_body "$file" | sed -ne '/[gG]it repository at:$/{n;n;p}')
+	pull_branch=$(message_print_body "$file" |
+		sed -ne '/[gG]it repository at:$/,/for you to fetch/{p}' |
+		sed -ne '3,$p' | sed -ne '0,/^$/p' | tr '\n' ' ')
+
 	from_line=$(grep '^From:' $file)
 
 	if [[ -z "$pull_branch" ]] ; then
-- 
2.20.1



More information about the dim-tools mailing list