[PATCH 2/2] dim: Fix outlook_author variable.
Lucas De Marchi
lucas.de.marchi at gmail.com
Wed Feb 21 21:47:58 UTC 2018
On Mon, Feb 19, 2018 at 04:51:46AM +0100, Daniel Vetter wrote:
> 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".
It seems it's actually from "First Last" to "Last, First".... but this
is not what the comment says... it should be converting the other way
around.
> 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/')
You are considering only First and Last without spaces, which isn't
globally true.
$ echo "De Marchi, Lucas" | sed -e 's/\([^ ]*\), \(.*\)/\2 \1/')
De Lucas Marchi
not what we want. This yields better results since we don't have to
deal with the ambiguous space like in the other way around:
author_from_outlook=$(git show -s $sha1 --format="format:%an" | sed -e 's/\(.*\), \(.*\)/\2 \1/')
Lucas De Marchi ("'De' is part of my last name :))
>
> 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
> _______________________________________________
> 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