* [maintainer-tools PATCH 1/7] dim: don't run add-missing-cc on merge commits
@ 2017-08-09 11:10 Eric Engestrom
2017-08-09 11:10 ` [maintainer-tools PATCH 2/7] dim: fix end-of-line in regex Eric Engestrom
` (6 more replies)
0 siblings, 7 replies; 10+ messages in thread
From: Eric Engestrom @ 2017-08-09 11:10 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula, Daniel Vetter, dri-devel
get_maintainer.pl needs a diff, so this script can't run on a merge
commit.
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
---
dim | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/dim b/dim
index 619d855b321b..af1baa11c7b2 100755
--- a/dim
+++ b/dim
@@ -1960,6 +1960,11 @@ function dim_fixes
function dim_add_missing_cc
{
+ if [ $(git cat-file -p HEAD | grep -cE ^parent) -ne 1 ]; then
+ echoerr "This script doesn't work on merge commits"
+ return
+ fi
+
git show | scripts/get_maintainer.pl --email --norolestats --pattern-depth 1 | while read cc; do
email="$(echo "$cc" | sed -e 's/.*<//' -e 's/>.*//')"
name=''
--
Cheers,
Eric
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [maintainer-tools PATCH 2/7] dim: fix end-of-line in regex
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 ` 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
` (5 subsequent siblings)
6 siblings, 1 reply; 10+ messages in thread
From: Eric Engestrom @ 2017-08-09 11:10 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula, Daniel Vetter, dri-devel
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
---
dim | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dim b/dim
index af1baa11c7b2..eaabcec43c8f 100755
--- a/dim
+++ b/dim
@@ -1970,7 +1970,7 @@ function dim_add_missing_cc
name=''
if echo "$cc" | grep -q '<'; then
- name="$(echo ${cc/<*/} | sed -e 's/[[:space:]]*\$//')";
+ name="$(echo ${cc/<*/} | sed -e 's/[[:space:]]*$//')";
fi
# Don't add main mailing lists
@@ -1988,7 +1988,7 @@ function dim_add_missing_cc
if [ "$testemail" != "$email" ]; then
if [ -z "$name" ]; then continue; fi
- testname="$(echo ${testcc/<*/} | sed -e 's/[[:space:]]*\$//' -e 's/^[[:space:]]*//')"
+ testname="$(echo ${testcc/<*/} | sed -e 's/[[:space:]]*$//' -e 's/^[[:space:]]*//')"
if [ "$testname" != "$name" ]; then continue; fi
fi
--
Cheers,
Eric
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [maintainer-tools PATCH 3/7] dim: split out email parsing functions
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 11:10 ` Eric Engestrom
2017-08-09 13:00 ` Jani Nikula
2017-08-09 11:10 ` [maintainer-tools PATCH 4/7] dim: merge string substitutions Eric Engestrom
` (4 subsequent siblings)
6 siblings, 1 reply; 10+ messages in thread
From: Eric Engestrom @ 2017-08-09 11:10 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula, Daniel Vetter, dri-devel
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"
+}
+
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
--
Cheers,
Eric
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [maintainer-tools PATCH 4/7] dim: merge string substitutions
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 11:10 ` [maintainer-tools PATCH 3/7] dim: split out email parsing functions Eric Engestrom
@ 2017-08-09 11:10 ` Eric Engestrom
2017-08-09 11:10 ` [maintainer-tools PATCH 5/7] dim: move empty name logic to function Eric Engestrom
` (3 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Eric Engestrom @ 2017-08-09 11:10 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula, Daniel Vetter, dri-devel
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
---
dim | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dim b/dim
index a656afa0d255..4ffac497c621 100755
--- a/dim
+++ b/dim
@@ -1965,7 +1965,7 @@ function email_get_address
function email_get_name
{
- echo ${cc/<*/} | sed -e 's/[[:space:]]*$//' <<< "$1"
+ sed -e 's/[[:space:]]*<.*$//' <<< "$1"
}
function dim_add_missing_cc
--
Cheers,
Eric
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [maintainer-tools PATCH 5/7] dim: move empty name logic to function
2017-08-09 11:10 [maintainer-tools PATCH 1/7] dim: don't run add-missing-cc on merge commits Eric Engestrom
` (2 preceding siblings ...)
2017-08-09 11:10 ` [maintainer-tools PATCH 4/7] dim: merge string substitutions Eric Engestrom
@ 2017-08-09 11:10 ` 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
` (2 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Eric Engestrom @ 2017-08-09 11:10 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula, Daniel Vetter, dri-devel
Fair warning: this slightly changes the behaviour, as $testname would
previously contain the email if $testcc didn't contain a name.
Shouldn't affect anything though.
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
---
dim | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/dim b/dim
index 4ffac497c621..481a53e23035 100755
--- a/dim
+++ b/dim
@@ -1965,7 +1965,9 @@ function email_get_address
function email_get_name
{
- sed -e 's/[[:space:]]*<.*$//' <<< "$1"
+ if grep -q '<' <<< "$1"; then
+ sed -e 's/[[:space:]]*<.*$//' <<< "$1"
+ fi
}
function dim_add_missing_cc
@@ -1977,11 +1979,7 @@ function dim_add_missing_cc
git show | scripts/get_maintainer.pl --email --norolestats --pattern-depth 1 | while read cc; do
email="$(email_get_address "$cc")"
- name=''
-
- if echo "$cc" | grep -q '<'; then
- name="$(email_get_name "$cc")";
- fi
+ name="$(email_get_name "$cc")"
# Don't add main mailing lists
if [ "$email" = "dri-devel@lists.freedesktop.org" -o \
--
Cheers,
Eric
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [maintainer-tools PATCH 6/7] dim: split out 'is email cc'ed in latest commit' to a function
2017-08-09 11:10 [maintainer-tools PATCH 1/7] dim: don't run add-missing-cc on merge commits Eric Engestrom
` (3 preceding siblings ...)
2017-08-09 11:10 ` [maintainer-tools PATCH 5/7] dim: move empty name logic to function Eric Engestrom
@ 2017-08-09 11:11 ` 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
6 siblings, 0 replies; 10+ messages in thread
From: Eric Engestrom @ 2017-08-09 11:11 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula, Daniel Vetter, dri-devel
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
---
dim | 46 ++++++++++++++++++++++++++--------------------
1 file changed, 26 insertions(+), 20 deletions(-)
diff --git a/dim b/dim
index 481a53e23035..2e22fefa8867 100755
--- a/dim
+++ b/dim
@@ -1970,6 +1970,31 @@ function email_get_name
fi
}
+function email_cc_in_latest_commit
+{
+ email="$1"
+ name="$2"
+
+ git show -s | grep -i "^ Cc:" | sed 's/^ *[Cc][Cc]: *//' | while read -r testcc; do
+ testemail="$(email_get_address "$testcc")"
+ testname="$(email_get_name "$testcc" | sed -e 's/^[[:space:]]*//')"
+
+ if [ "$testemail" = "$email" ]; then
+ return 1
+ fi
+
+ if [ -z "$testname" ] || [ -z "$name" ]; then
+ continue
+ fi
+
+ if [ "$testname" = "$name" ]; then
+ return 1
+ fi
+ done || return 0
+
+ return 1
+}
+
function dim_add_missing_cc
{
if [ $(git cat-file -p HEAD | grep -cE ^parent) -ne 1 ]; then
@@ -1987,26 +2012,7 @@ function dim_add_missing_cc
continue
fi
- # Variables from the while loop don't propagate,
- # print out a 1 on success
- matches=$(
- git show -s | grep -i "^ Cc:" | sed 's/^ *[Cc][Cc]: *//' | while read testcc; do
- testemail="$(email_get_address "$testcc")"
-
- if [ "$testemail" != "$email" ]; then
- if [ -z "$name" ]; then continue; fi
-
- testname="$(email_get_name "$testcc" | sed -e 's/^[[:space:]]*//')"
-
- if [ "$testname" != "$name" ]; then continue; fi
- fi
-
- echo 1
- break
- done
- )
-
- if [ -z "$matches" ]; then
+ if ! email_cc_in_latest_commit "$email" "$name"; then
$DRY dim_commit_add_tag "Cc: ${cc}"
fi
done
--
Cheers,
Eric
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [maintainer-tools PATCH 7/7] dim: protect against escaped chars when reading cc'ed emails
2017-08-09 11:10 [maintainer-tools PATCH 1/7] dim: don't run add-missing-cc on merge commits Eric Engestrom
` (4 preceding siblings ...)
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 ` Eric Engestrom
2017-08-09 12:55 ` [maintainer-tools PATCH 1/7] dim: don't run add-missing-cc on merge commits Jani Nikula
6 siblings, 0 replies; 10+ messages in thread
From: Eric Engestrom @ 2017-08-09 11:11 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula, Daniel Vetter, dri-devel
Suggested by shellcheck (`make check`).
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
---
dim | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dim b/dim
index 2e22fefa8867..75ce55188af4 100755
--- a/dim
+++ b/dim
@@ -2002,7 +2002,7 @@ function dim_add_missing_cc
return
fi
- git show | scripts/get_maintainer.pl --email --norolestats --pattern-depth 1 | while read cc; do
+ git show | scripts/get_maintainer.pl --email --norolestats --pattern-depth 1 | while read -r cc; do
email="$(email_get_address "$cc")"
name="$(email_get_name "$cc")"
--
Cheers,
Eric
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [maintainer-tools PATCH 1/7] dim: don't run add-missing-cc on merge commits
2017-08-09 11:10 [maintainer-tools PATCH 1/7] dim: don't run add-missing-cc on merge commits Eric Engestrom
` (5 preceding siblings ...)
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 ` Jani Nikula
6 siblings, 0 replies; 10+ messages in thread
From: Jani Nikula @ 2017-08-09 12:55 UTC (permalink / raw)
To: Eric Engestrom, intel-gfx; +Cc: Daniel Vetter, dri-devel
On Wed, 09 Aug 2017, Eric Engestrom <eric.engestrom@imgtec.com> wrote:
> get_maintainer.pl needs a diff, so this script can't run on a merge
> commit.
>
> Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
> ---
> dim | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/dim b/dim
> index 619d855b321b..af1baa11c7b2 100755
> --- a/dim
> +++ b/dim
> @@ -1960,6 +1960,11 @@ function dim_fixes
>
> function dim_add_missing_cc
> {
> + if [ $(git cat-file -p HEAD | grep -cE ^parent) -ne 1 ]; then
> + echoerr "This script doesn't work on merge commits"
To be pedantic, it's the subcommand that fails on merges, not the
script.
> + return
Please return 1.
BR,
Jani.
> + fi
> +
> git show | scripts/get_maintainer.pl --email --norolestats --pattern-depth 1 | while read cc; do
> email="$(echo "$cc" | sed -e 's/.*<//' -e 's/>.*//')"
> name=''
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [maintainer-tools PATCH 2/7] dim: fix end-of-line in regex
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
0 siblings, 0 replies; 10+ messages in thread
From: Jani Nikula @ 2017-08-09 12:57 UTC (permalink / raw)
To: Eric Engestrom, intel-gfx; +Cc: Daniel Vetter, dri-devel
On Wed, 09 Aug 2017, Eric Engestrom <eric.engestrom@imgtec.com> wrote:
> Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
> ---
> dim | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/dim b/dim
> index af1baa11c7b2..eaabcec43c8f 100755
> --- a/dim
> +++ b/dim
> @@ -1970,7 +1970,7 @@ function dim_add_missing_cc
> name=''
>
> if echo "$cc" | grep -q '<'; then
> - name="$(echo ${cc/<*/} | sed -e 's/[[:space:]]*\$//')";
> + name="$(echo ${cc/<*/} | sed -e 's/[[:space:]]*$//')";
What's the failure mode? It never nukes trailing space after all? Please
say so in the commit message.
BR,
Jani.
> fi
>
> # Don't add main mailing lists
> @@ -1988,7 +1988,7 @@ function dim_add_missing_cc
> if [ "$testemail" != "$email" ]; then
> if [ -z "$name" ]; then continue; fi
>
> - testname="$(echo ${testcc/<*/} | sed -e 's/[[:space:]]*\$//' -e 's/^[[:space:]]*//')"
> + testname="$(echo ${testcc/<*/} | sed -e 's/[[:space:]]*$//' -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
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [maintainer-tools PATCH 3/7] dim: split out email parsing functions
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
0 siblings, 0 replies; 10+ messages in thread
From: Jani Nikula @ 2017-08-09 13:00 UTC (permalink / raw)
To: Eric Engestrom, intel-gfx; +Cc: Daniel Vetter, dri-devel
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
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2017-08-09 13:00 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.