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

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Tue Feb 19 14:18:15 UTC 2019


Quoting Daniel Vetter (2019-02-19 11:58:01)
> 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' ' ')

I'm sure some sed expert could turn this into single sed call, but
anyway:

Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Regards, Joonas

> +
>         from_line=$(grep '^From:' $file)
>  
>         if [[ -z "$pull_branch" ]] ; then
> -- 
> 2.20.1
> 
> _______________________________________________
> dim-tools mailing list
> dim-tools at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dim-tools


More information about the dim-tools mailing list