[PATCH 2/2] dim: Fix outlook_author variable.
Daniel Vetter
daniel at ffwll.ch
Mon Feb 19 03:51:46 UTC 2018
On Thu, Feb 15, 2018 at 11:14:10AM -0800, Rodrigo Vivi wrote:
> The current version author_outlook ends up like
> "First, Last," instead of "First Last" as it should be.
>
> Honestly I'm so glad that this never worked. So I had a chance
> to contact authors before merging the patch and fix the
> outlook + patchwork mess.
>
> But anyways, if we decide to stay with this logic let's at least
> fix it.
>
> Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> ---
> dim | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/dim b/dim
> index 4493b48b1494..ed8b9b03c42a 100755
> --- a/dim
> +++ b/dim
> @@ -732,7 +732,7 @@ function checkpatch_commit_push
> author=$(git show -s $sha1 --format="format:%an")
> committer=$(git show -s $sha1 --format="format:%cn")
> # outlook mangles mails into "Last, First"
> - author_outlook=$(git show -s $sha1 --format="format:%an" | sed -e 's/\([^ ]*\) \(.*\)/\2, \1/')
> + author_outlook=$(git show -s $sha1 --format="format:%an" | sed -e 's/\([^ ]*\) \(.*\)/\2 \1/;s/,//')
The above regex (the original one) moves from "Last, First" to "First
Last". Sounds like we need a 2nd path for the other direction? Also
simpler to remove the ',' with one regex, like this:
author_from_outlook=$(git show -s $sha1 --format="format:%an" | sed -e 's/\([^ ]*\), \(.*\)/\2 \1/')
Cheers, Daniel
>
> # check for author sign-off
> if ! git show -s $sha1 | grep -qi "S.*-by:.*\\($author\\|$author_outlook\\)" ; then
> --
> 2.13.6
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the dim-tools
mailing list