All of lore.kernel.org
 help / color / mirror / Atom feed
* [maintainer-tools PATCH] dim: Add pull request tag headers
@ 2017-05-02 14:55 Sean Paul
  2017-05-02 14:58 ` Sean Paul
  2017-05-02 18:27 ` [maintainer-tools PATCH v2] " Sean Paul
  0 siblings, 2 replies; 6+ messages in thread
From: Sean Paul @ 2017-05-02 14:55 UTC (permalink / raw)
  To: intel-gfx, daniel.vetter, jani.nikula

Add some standard headers to the pull request tag annotation.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 dim     | 25 ++++++++++++++++++++++++-
 dim.rst |  4 ++++
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/dim b/dim
index 8937803..0d52e9d 100755
--- a/dim
+++ b/dim
@@ -67,6 +67,9 @@ DIM_TEMPLATE_HELLO=${DIM_TEMPLATE_HELLO:-$HOME/.dim.template.hello}
 # signature pull request template
 DIM_TEMPLATE_SIGNATURE=${DIM_TEMPLATE_SIGNATURE:-$HOME/.dim.template.signature}
 
+# pull request headers template
+DIM_TEMPLATE_PULL_HEADERS=${DIM_TEMPLATE_PULL_HEADERS:-$HOME/.dim.template.pullheaders}
+
 #
 # Internal configuration.
 #
@@ -1501,10 +1504,28 @@ function dim_tag_next
 
 }
 
+function prep_pull_tag_headers
+{
+	local template
+
+	if [ -r $DIM_TEMPLATE_PULL_HEADERS ]; then
+		while read -r m || [[ -n "$line" ]]; do
+			template="$template -m '$m'"
+		done < "$DIM_TEMPLATE_PULL_HEADERS"
+	else
+		template="-m 'UABI Changes:'"
+		template="$template -m 'Cross-subsystem Changes:'"
+		template="$template -m 'Core Changes:'"
+		template="$template -m 'Driver Changes:'"
+	fi
+	echo $template
+}
+
 # dim_pull_request branch upstream
 function dim_pull_request
 {
 	local branch upstream remote repo req_file url git_url suffix tag
+	local tag_headers
 
 	branch=${1:?$usage}
 	upstream=${2:?$usage}
@@ -1535,7 +1556,9 @@ function dim_pull_request
 		done
 
 		gitk "$branch@{upstream}" ^$upstream &
-		$DRY git tag -a $tag "$branch@{upstream}"
+		tag_headers=$(prep_pull_tag_headers)
+		$DRY git tag $tag_headers $tag "$branch@{upstream}"
+		$DRY git tag -a -f $tag
 		$DRY git push $remote $tag
 		prep_pull_mail $req_file $tag
 
diff --git a/dim.rst b/dim.rst
index 3dd19f9..02a7a55 100644
--- a/dim.rst
+++ b/dim.rst
@@ -464,6 +464,10 @@ DIM_TEMPLATE_SIGNATURE
 ----------------------
 Path to a file containing a signature template for pull request mails.
 
+DIM_TEMPLATE_PULL_HEADERS
+-------------------------
+Path to a file containing pull request headers, each on their own line.
+
 dim_alias_<alias>
 -----------------
 Make **<alias>** an alias for the subcommand defined as the value. For example,
-- 
2.13.0.rc1.294.g07d810a77f-goog

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [maintainer-tools PATCH] dim: Add pull request tag headers
  2017-05-02 14:55 [maintainer-tools PATCH] dim: Add pull request tag headers Sean Paul
@ 2017-05-02 14:58 ` Sean Paul
  2017-05-02 18:27 ` [maintainer-tools PATCH v2] " Sean Paul
  1 sibling, 0 replies; 6+ messages in thread
From: Sean Paul @ 2017-05-02 14:58 UTC (permalink / raw)
  To: Intel Graphics Development, Jani Nikula, Daniel Vetter

On Tue, May 2, 2017 at 10:55 AM, Sean Paul <seanpaul@chromium.org> wrote:
> Add some standard headers to the pull request tag annotation.
>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> ---

This time to Daniel's actual address.

Note that I couldn't add the headers as comments since git tag -m
skips anything prefixed with #. Hopefully having the ability to
override the headers makes up for this.

Sean

>  dim     | 25 ++++++++++++++++++++++++-
>  dim.rst |  4 ++++
>  2 files changed, 28 insertions(+), 1 deletion(-)
>
> diff --git a/dim b/dim
> index 8937803..0d52e9d 100755
> --- a/dim
> +++ b/dim
> @@ -67,6 +67,9 @@ DIM_TEMPLATE_HELLO=${DIM_TEMPLATE_HELLO:-$HOME/.dim.template.hello}
>  # signature pull request template
>  DIM_TEMPLATE_SIGNATURE=${DIM_TEMPLATE_SIGNATURE:-$HOME/.dim.template.signature}
>
> +# pull request headers template
> +DIM_TEMPLATE_PULL_HEADERS=${DIM_TEMPLATE_PULL_HEADERS:-$HOME/.dim.template.pullheaders}
> +
>  #
>  # Internal configuration.
>  #
> @@ -1501,10 +1504,28 @@ function dim_tag_next
>
>  }
>
> +function prep_pull_tag_headers
> +{
> +       local template
> +
> +       if [ -r $DIM_TEMPLATE_PULL_HEADERS ]; then
> +               while read -r m || [[ -n "$line" ]]; do
> +                       template="$template -m '$m'"
> +               done < "$DIM_TEMPLATE_PULL_HEADERS"
> +       else
> +               template="-m 'UABI Changes:'"
> +               template="$template -m 'Cross-subsystem Changes:'"
> +               template="$template -m 'Core Changes:'"
> +               template="$template -m 'Driver Changes:'"
> +       fi
> +       echo $template
> +}
> +
>  # dim_pull_request branch upstream
>  function dim_pull_request
>  {
>         local branch upstream remote repo req_file url git_url suffix tag
> +       local tag_headers
>
>         branch=${1:?$usage}
>         upstream=${2:?$usage}
> @@ -1535,7 +1556,9 @@ function dim_pull_request
>                 done
>
>                 gitk "$branch@{upstream}" ^$upstream &
> -               $DRY git tag -a $tag "$branch@{upstream}"
> +               tag_headers=$(prep_pull_tag_headers)
> +               $DRY git tag $tag_headers $tag "$branch@{upstream}"
> +               $DRY git tag -a -f $tag
>                 $DRY git push $remote $tag
>                 prep_pull_mail $req_file $tag
>
> diff --git a/dim.rst b/dim.rst
> index 3dd19f9..02a7a55 100644
> --- a/dim.rst
> +++ b/dim.rst
> @@ -464,6 +464,10 @@ DIM_TEMPLATE_SIGNATURE
>  ----------------------
>  Path to a file containing a signature template for pull request mails.
>
> +DIM_TEMPLATE_PULL_HEADERS
> +-------------------------
> +Path to a file containing pull request headers, each on their own line.
> +
>  dim_alias_<alias>
>  -----------------
>  Make **<alias>** an alias for the subcommand defined as the value. For example,
> --
> 2.13.0.rc1.294.g07d810a77f-goog
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [maintainer-tools PATCH v2] dim: Add pull request tag headers
  2017-05-02 14:55 [maintainer-tools PATCH] dim: Add pull request tag headers Sean Paul
  2017-05-02 14:58 ` Sean Paul
@ 2017-05-02 18:27 ` Sean Paul
  2017-05-03  7:50   ` Jani Nikula
  2017-05-03 15:30   ` [maintainer-tools PATCH v3] dim: Add pull request tag template Sean Paul
  1 sibling, 2 replies; 6+ messages in thread
From: Sean Paul @ 2017-05-02 18:27 UTC (permalink / raw)
  To: intel-gfx, daniel.vetter, jani.nikula

Add some standard headers to the pull request tag annotation.

Changes in v2:
  - Tweaked the template var name s/PULL/TAG/ (Daniel)

Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 dim     | 25 ++++++++++++++++++++++++-
 dim.rst |  4 ++++
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/dim b/dim
index 8937803..e94eb0c 100755
--- a/dim
+++ b/dim
@@ -67,6 +67,9 @@ DIM_TEMPLATE_HELLO=${DIM_TEMPLATE_HELLO:-$HOME/.dim.template.hello}
 # signature pull request template
 DIM_TEMPLATE_SIGNATURE=${DIM_TEMPLATE_SIGNATURE:-$HOME/.dim.template.signature}
 
+# tag headers for pull requests
+DIM_TEMPLATE_TAG_HEADERS=${DIM_TEMPLATE_TAG_HEADERS:-$HOME/.dim.template.tagheaders}
+
 #
 # Internal configuration.
 #
@@ -1501,10 +1504,28 @@ function dim_tag_next
 
 }
 
+function prep_pull_tag_headers
+{
+	local template
+
+	if [ -r $DIM_TEMPLATE_TAG_HEADERS ]; then
+		while read -r m || [[ -n "$line" ]]; do
+			template="$template -m '$m'"
+		done < "$DIM_TEMPLATE_TAG_HEADERS"
+	else
+		template="-m 'UABI Changes:'"
+		template="$template -m 'Cross-subsystem Changes:'"
+		template="$template -m 'Core Changes:'"
+		template="$template -m 'Driver Changes:'"
+	fi
+	echo $template
+}
+
 # dim_pull_request branch upstream
 function dim_pull_request
 {
 	local branch upstream remote repo req_file url git_url suffix tag
+	local tag_headers
 
 	branch=${1:?$usage}
 	upstream=${2:?$usage}
@@ -1535,7 +1556,9 @@ function dim_pull_request
 		done
 
 		gitk "$branch@{upstream}" ^$upstream &
-		$DRY git tag -a $tag "$branch@{upstream}"
+		tag_headers=$(prep_pull_tag_headers)
+		$DRY git tag $tag_headers $tag "$branch@{upstream}"
+		$DRY git tag -a -f $tag
 		$DRY git push $remote $tag
 		prep_pull_mail $req_file $tag
 
diff --git a/dim.rst b/dim.rst
index 3dd19f9..d6438a3 100644
--- a/dim.rst
+++ b/dim.rst
@@ -464,6 +464,10 @@ DIM_TEMPLATE_SIGNATURE
 ----------------------
 Path to a file containing a signature template for pull request mails.
 
+DIM_TEMPLATE_TAG_HEADERS
+-------------------------
+Path to a file containing tag headers for pull requests, each on their own line.
+
 dim_alias_<alias>
 -----------------
 Make **<alias>** an alias for the subcommand defined as the value. For example,
-- 
2.13.0.rc1.294.g07d810a77f-goog

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [maintainer-tools PATCH v2] dim: Add pull request tag headers
  2017-05-02 18:27 ` [maintainer-tools PATCH v2] " Sean Paul
@ 2017-05-03  7:50   ` Jani Nikula
  2017-05-03 15:30   ` [maintainer-tools PATCH v3] dim: Add pull request tag template Sean Paul
  1 sibling, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2017-05-03  7:50 UTC (permalink / raw)
  To: Sean Paul, intel-gfx, daniel.vetter

On Tue, 02 May 2017, Sean Paul <seanpaul@chromium.org> wrote:
> Add some standard headers to the pull request tag annotation.

I've read the subject, commit message, and code twice, and I have no
clue what you want to achieve here. Please elaborate.

BR,
Jani.


>
> Changes in v2:
>   - Tweaked the template var name s/PULL/TAG/ (Daniel)
>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> ---
>  dim     | 25 ++++++++++++++++++++++++-
>  dim.rst |  4 ++++
>  2 files changed, 28 insertions(+), 1 deletion(-)
>
> diff --git a/dim b/dim
> index 8937803..e94eb0c 100755
> --- a/dim
> +++ b/dim
> @@ -67,6 +67,9 @@ DIM_TEMPLATE_HELLO=${DIM_TEMPLATE_HELLO:-$HOME/.dim.template.hello}
>  # signature pull request template
>  DIM_TEMPLATE_SIGNATURE=${DIM_TEMPLATE_SIGNATURE:-$HOME/.dim.template.signature}
>  
> +# tag headers for pull requests
> +DIM_TEMPLATE_TAG_HEADERS=${DIM_TEMPLATE_TAG_HEADERS:-$HOME/.dim.template.tagheaders}
> +
>  #
>  # Internal configuration.
>  #
> @@ -1501,10 +1504,28 @@ function dim_tag_next
>  
>  }
>  
> +function prep_pull_tag_headers
> +{
> +	local template
> +
> +	if [ -r $DIM_TEMPLATE_TAG_HEADERS ]; then
> +		while read -r m || [[ -n "$line" ]]; do
> +			template="$template -m '$m'"
> +		done < "$DIM_TEMPLATE_TAG_HEADERS"
> +	else
> +		template="-m 'UABI Changes:'"
> +		template="$template -m 'Cross-subsystem Changes:'"
> +		template="$template -m 'Core Changes:'"
> +		template="$template -m 'Driver Changes:'"
> +	fi
> +	echo $template
> +}
> +
>  # dim_pull_request branch upstream
>  function dim_pull_request
>  {
>  	local branch upstream remote repo req_file url git_url suffix tag
> +	local tag_headers
>  
>  	branch=${1:?$usage}
>  	upstream=${2:?$usage}
> @@ -1535,7 +1556,9 @@ function dim_pull_request
>  		done
>  
>  		gitk "$branch@{upstream}" ^$upstream &
> -		$DRY git tag -a $tag "$branch@{upstream}"
> +		tag_headers=$(prep_pull_tag_headers)
> +		$DRY git tag $tag_headers $tag "$branch@{upstream}"
> +		$DRY git tag -a -f $tag
>  		$DRY git push $remote $tag
>  		prep_pull_mail $req_file $tag
>  
> diff --git a/dim.rst b/dim.rst
> index 3dd19f9..d6438a3 100644
> --- a/dim.rst
> +++ b/dim.rst
> @@ -464,6 +464,10 @@ DIM_TEMPLATE_SIGNATURE
>  ----------------------
>  Path to a file containing a signature template for pull request mails.
>  
> +DIM_TEMPLATE_TAG_HEADERS
> +-------------------------
> +Path to a file containing tag headers for pull requests, each on their own line.
> +
>  dim_alias_<alias>
>  -----------------
>  Make **<alias>** an alias for the subcommand defined as the value. For example,

-- 
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] 6+ messages in thread

* [maintainer-tools PATCH v3] dim: Add pull request tag template
  2017-05-02 18:27 ` [maintainer-tools PATCH v2] " Sean Paul
  2017-05-03  7:50   ` Jani Nikula
@ 2017-05-03 15:30   ` Sean Paul
  2017-05-04  8:07     ` Jani Nikula
  1 sibling, 1 reply; 6+ messages in thread
From: Sean Paul @ 2017-05-03 15:30 UTC (permalink / raw)
  To: intel-gfx, daniel.vetter, jani.nikula

Each pull request is accompanied by a summary that is stored in the git tag
from which it is generated. These summaries all share the same template with
headers classifying changes to UAPI, Cross-subsystem, Core, and Drivers. This
patch adds this template to the tag summary automatically in dim pull-request.

Changes in v2:
  - Tweaked the template var name s/PULL/TAG/ (Daniel)
Changes in v3:
  - Use git tag -F- to ingest template (Jani)
  - Tweak naming/comments again to hopefully clarify things (Jani)

Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 dim     | 25 +++++++++++++++++++++++--
 dim.rst |  4 ++++
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/dim b/dim
index 8937803..baa0b38 100755
--- a/dim
+++ b/dim
@@ -67,6 +67,9 @@ DIM_TEMPLATE_HELLO=${DIM_TEMPLATE_HELLO:-$HOME/.dim.template.hello}
 # signature pull request template
 DIM_TEMPLATE_SIGNATURE=${DIM_TEMPLATE_SIGNATURE:-$HOME/.dim.template.signature}
 
+# dim pull-request tag summary template
+DIM_TEMPLATE_TAG_SUMMARY=${DIM_TEMPLATE_TAG_SUMMARY:-$HOME/.dim.template.tagsummary}
+
 #
 # Internal configuration.
 #
@@ -1501,6 +1504,24 @@ function dim_tag_next
 
 }
 
+function prep_pull_tag_summary
+{
+	if [ -r $DIM_TEMPLATE_TAG_SUMMARY ]; then
+		cat $DIM_TEMPLATE_TAG_SUMMARY
+	else
+		cat <<-EOF
+		UAPI Changes:
+
+		Cross-subsystem Changes:
+
+		Core Changes:
+
+		Driver Changes:
+
+		EOF
+	fi
+}
+
 # dim_pull_request branch upstream
 function dim_pull_request
 {
@@ -1533,9 +1554,9 @@ function dim_pull_request
 		while git tag -l $tag | grep -q $tag ; do
 			tag="$branch-$today-$((++suffix))"
 		done
-
 		gitk "$branch@{upstream}" ^$upstream &
-		$DRY git tag -a $tag "$branch@{upstream}"
+		prep_pull_tag_summary | $DRY git tag -F- $tag "$branch@{upstream}"
+		$DRY git tag -a -f $tag
 		$DRY git push $remote $tag
 		prep_pull_mail $req_file $tag
 
diff --git a/dim.rst b/dim.rst
index 3dd19f9..10572f1 100644
--- a/dim.rst
+++ b/dim.rst
@@ -464,6 +464,10 @@ DIM_TEMPLATE_SIGNATURE
 ----------------------
 Path to a file containing a signature template for pull request mails.
 
+DIM_TEMPLATE_TAG_SUMMARY
+-------------------------
+Path to a file containing the template for dim pull-request tag summaries.
+
 dim_alias_<alias>
 -----------------
 Make **<alias>** an alias for the subcommand defined as the value. For example,
-- 
2.13.0.rc1.294.g07d810a77f-goog

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [maintainer-tools PATCH v3] dim: Add pull request tag template
  2017-05-03 15:30   ` [maintainer-tools PATCH v3] dim: Add pull request tag template Sean Paul
@ 2017-05-04  8:07     ` Jani Nikula
  0 siblings, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2017-05-04  8:07 UTC (permalink / raw)
  To: Sean Paul, intel-gfx, daniel.vetter

On Wed, 03 May 2017, Sean Paul <seanpaul@chromium.org> wrote:
> Each pull request is accompanied by a summary that is stored in the git tag
> from which it is generated. These summaries all share the same template with
> headers classifying changes to UAPI, Cross-subsystem, Core, and Drivers. This
> patch adds this template to the tag summary automatically in dim pull-request.
>
> Changes in v2:
>   - Tweaked the template var name s/PULL/TAG/ (Daniel)
> Changes in v3:
>   - Use git tag -F- to ingest template (Jani)
>   - Tweak naming/comments again to hopefully clarify things (Jani)
>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>

Pushed, thanks.

BR,
Jani.

> ---
>  dim     | 25 +++++++++++++++++++++++--
>  dim.rst |  4 ++++
>  2 files changed, 27 insertions(+), 2 deletions(-)
>
> diff --git a/dim b/dim
> index 8937803..baa0b38 100755
> --- a/dim
> +++ b/dim
> @@ -67,6 +67,9 @@ DIM_TEMPLATE_HELLO=${DIM_TEMPLATE_HELLO:-$HOME/.dim.template.hello}
>  # signature pull request template
>  DIM_TEMPLATE_SIGNATURE=${DIM_TEMPLATE_SIGNATURE:-$HOME/.dim.template.signature}
>  
> +# dim pull-request tag summary template
> +DIM_TEMPLATE_TAG_SUMMARY=${DIM_TEMPLATE_TAG_SUMMARY:-$HOME/.dim.template.tagsummary}
> +
>  #
>  # Internal configuration.
>  #
> @@ -1501,6 +1504,24 @@ function dim_tag_next
>  
>  }
>  
> +function prep_pull_tag_summary
> +{
> +	if [ -r $DIM_TEMPLATE_TAG_SUMMARY ]; then
> +		cat $DIM_TEMPLATE_TAG_SUMMARY
> +	else
> +		cat <<-EOF
> +		UAPI Changes:
> +
> +		Cross-subsystem Changes:
> +
> +		Core Changes:
> +
> +		Driver Changes:
> +
> +		EOF
> +	fi
> +}
> +
>  # dim_pull_request branch upstream
>  function dim_pull_request
>  {
> @@ -1533,9 +1554,9 @@ function dim_pull_request
>  		while git tag -l $tag | grep -q $tag ; do
>  			tag="$branch-$today-$((++suffix))"
>  		done
> -
>  		gitk "$branch@{upstream}" ^$upstream &
> -		$DRY git tag -a $tag "$branch@{upstream}"
> +		prep_pull_tag_summary | $DRY git tag -F- $tag "$branch@{upstream}"
> +		$DRY git tag -a -f $tag
>  		$DRY git push $remote $tag
>  		prep_pull_mail $req_file $tag
>  
> diff --git a/dim.rst b/dim.rst
> index 3dd19f9..10572f1 100644
> --- a/dim.rst
> +++ b/dim.rst
> @@ -464,6 +464,10 @@ DIM_TEMPLATE_SIGNATURE
>  ----------------------
>  Path to a file containing a signature template for pull request mails.
>  
> +DIM_TEMPLATE_TAG_SUMMARY
> +-------------------------
> +Path to a file containing the template for dim pull-request tag summaries.
> +
>  dim_alias_<alias>
>  -----------------
>  Make **<alias>** an alias for the subcommand defined as the value. For example,

-- 
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] 6+ messages in thread

end of thread, other threads:[~2017-05-04  8:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-02 14:55 [maintainer-tools PATCH] dim: Add pull request tag headers Sean Paul
2017-05-02 14:58 ` Sean Paul
2017-05-02 18:27 ` [maintainer-tools PATCH v2] " Sean Paul
2017-05-03  7:50   ` Jani Nikula
2017-05-03 15:30   ` [maintainer-tools PATCH v3] dim: Add pull request tag template Sean Paul
2017-05-04  8:07     ` 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.