From: Jani Nikula <jani.nikula@intel.com>
To: Eric Engestrom <eric.engestrom@imgtec.com>,
intel-gfx@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, dri-devel@lists.freedesktop.org
Subject: Re: [maintainer-tools PATCH 3/7] dim: split out email parsing functions
Date: Wed, 09 Aug 2017 16:00:51 +0300 [thread overview]
Message-ID: <87r2wkuc8s.fsf@intel.com> (raw)
In-Reply-To: <20170809111101.11315-3-eric.engestrom@imgtec.com>
On Wed, 09 Aug 2017, Eric Engestrom <eric.engestrom@imgtec.com> wrote:
> Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
> ---
> dim | 18 ++++++++++++++----
> 1 file changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/dim b/dim
> index eaabcec43c8f..a656afa0d255 100755
> --- a/dim
> +++ b/dim
> @@ -1958,6 +1958,16 @@ function dim_fixes
> fi
> }
>
> +function email_get_address
> +{
> + sed -e 's/.*<//' -e 's/>.*//' <<< "$1"
> +}
> +
> +function email_get_name
> +{
> + echo ${cc/<*/} | sed -e 's/[[:space:]]*$//' <<< "$1"
I don't think the ${cc bit belongs in this function, even for the
transitional period until you fix it in a later patch.
BR,
Jani.
> +}
> +
> function dim_add_missing_cc
> {
> if [ $(git cat-file -p HEAD | grep -cE ^parent) -ne 1 ]; then
> @@ -1966,11 +1976,11 @@ function dim_add_missing_cc
> fi
>
> git show | scripts/get_maintainer.pl --email --norolestats --pattern-depth 1 | while read cc; do
> - email="$(echo "$cc" | sed -e 's/.*<//' -e 's/>.*//')"
> + email="$(email_get_address "$cc")"
> name=''
>
> if echo "$cc" | grep -q '<'; then
> - name="$(echo ${cc/<*/} | sed -e 's/[[:space:]]*$//')";
> + name="$(email_get_name "$cc")";
> fi
>
> # Don't add main mailing lists
> @@ -1983,12 +1993,12 @@ function dim_add_missing_cc
> # print out a 1 on success
> matches=$(
> git show -s | grep -i "^ Cc:" | sed 's/^ *[Cc][Cc]: *//' | while read testcc; do
> - testemail="$(echo "$testcc" | sed -e 's/.*<//' -e 's/>.*//')"
> + testemail="$(email_get_address "$testcc")"
>
> if [ "$testemail" != "$email" ]; then
> if [ -z "$name" ]; then continue; fi
>
> - testname="$(echo ${testcc/<*/} | sed -e 's/[[:space:]]*$//' -e 's/^[[:space:]]*//')"
> + testname="$(email_get_name "$testcc" | sed -e 's/^[[:space:]]*//')"
>
> if [ "$testname" != "$name" ]; then continue; fi
> fi
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-08-09 13:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-09 11:10 [maintainer-tools PATCH 1/7] dim: don't run add-missing-cc on merge commits Eric Engestrom
2017-08-09 11:10 ` [maintainer-tools PATCH 2/7] dim: fix end-of-line in regex Eric Engestrom
2017-08-09 12:57 ` Jani Nikula
2017-08-09 11:10 ` [maintainer-tools PATCH 3/7] dim: split out email parsing functions Eric Engestrom
2017-08-09 13:00 ` Jani Nikula [this message]
2017-08-09 11:10 ` [maintainer-tools PATCH 4/7] dim: merge string substitutions Eric Engestrom
2017-08-09 11:10 ` [maintainer-tools PATCH 5/7] dim: move empty name logic to function Eric Engestrom
2017-08-09 11:11 ` [maintainer-tools PATCH 6/7] dim: split out 'is email cc'ed in latest commit' to a function Eric Engestrom
2017-08-09 11:11 ` [maintainer-tools PATCH 7/7] dim: protect against escaped chars when reading cc'ed emails Eric Engestrom
2017-08-09 12:55 ` [maintainer-tools PATCH 1/7] dim: don't run add-missing-cc on merge commits Jani Nikula
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r2wkuc8s.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=eric.engestrom@imgtec.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).