From: Jani Nikula <jani.nikula@linux.intel.com>
To: Sean Paul <seanpaul@chromium.org>,
intel-gfx@lists.freedesktop.org, ville.syrjala@linux.intel.com
Subject: Re: [maintainer-tools PATCH v2 2/2] dim: Curate and insert tags into patch(es)
Date: Thu, 06 Apr 2017 14:50:47 +0300 [thread overview]
Message-ID: <878tndzre0.fsf@intel.com> (raw)
In-Reply-To: <20170403211016.35047-1-seanpaul@chromium.org>
[Apologies, I thought I'd sent this, but it was in drafts...]
On Tue, 04 Apr 2017, Sean Paul <seanpaul@chromium.org> wrote:
> Launch $EDITOR when extracting tags to curate the tags immediately. Once the
> tags are proper, automatically add them before the first Signed-off-by line
> to all patches in the range.
>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> ---
> Changes in v2:
> - Append the tags before the committer's SoB (Ville)
> - Make launching $EDITOR contingent on -i flag (Ville/Jani)
> - Fix tty issues when launching editor
>
>
> dim | 44 +++++++++++++++++++++++++++++++++++---------
> 1 file changed, 35 insertions(+), 9 deletions(-)
>
> diff --git a/dim b/dim
> index 334882b..8b9a876 100755
> --- a/dim
> +++ b/dim
> @@ -670,13 +670,23 @@ function dim_push_fixes
> dim_push_branch drm-intel-fixes "$@"
> }
>
> +function get_committer_email
> +{
> + local committer_email
> +
> + if ! committer_email=$(git config --get user.email) ; then
> + committer_email=$EMAIL
> + fi
> + echo -n $committer_email
> +}
> +
> # ensure we're on branch $1, and apply patches. the rest of the arguments are
> # passed to git am.
> dim_alias_ab=apply-branch
> dim_alias_sob=apply-branch
> function dim_apply_branch
> {
> - local branch file message_id commiter_email patch_from sob rv
> + local branch file message_id committer_email patch_from sob rv
>
> branch=${1:?$usage}
> shift
> @@ -688,13 +698,10 @@ function dim_apply_branch
> cat > $file
>
> message_id=$(message_get_id $file)
> -
> - if ! commiter_email=$(git config --get user.email) ; then
> - commiter_email=$EMAIL
> - fi
> + committer_email=$(get_committer_email)
>
> patch_from=$(grep "From:" "$file" | head -1)
> - if [[ "$patch_from" != *"$commiter_email"* ]] ; then
> + if [[ "$patch_from" != *"$committer_email"* ]] ; then
> sob=-s
> fi
>
> @@ -1156,6 +1163,15 @@ function rangeish()
> fi
> }
>
> +function insert_extracted_tags
> +{
> + local committer_email new_tags sob
> + committer_email=$(get_committer_email)
> + new_tags=$(awk '{ORS="\\\\n"} {print $0}' $1 | head -c-3)
> + sob="Signed-off-by: .*<$committer_email>"
> + awk "/$sob/{p++} p==1{print \"$new_tags\"; p++} p!=1{print}"
> +}
> +
> function dim_extract_tags
> {
> local branch range file tags
> @@ -1177,9 +1193,19 @@ function dim_extract_tags
> return 0
> fi
>
> - tags=$(printf -- "# *** extracted tags ***\n%s" "$tags")
> -
> - git filter-branch -f --msg-filter "cat ; echo \"$tags\"" $range
> + # If interactive is selected, launch an editor to allow tag editing
> + # If it's not, just append the tags at the bottom of the commit
> + if [ "$INTERACTIVE" ]; then
Sorry, interactive doesn't do what you think it does. It just
pauses. Blame Daniel. ;)
Which again means that this will fail for my workflow. :(
> + echo "$tags" > $file
> + ${EDITOR:-vi} $file >/dev/tty</dev/tty
Why vi? Why the redirects?
BR,
Jani.
> + export -f get_committer_email insert_extracted_tags
> + insert_extracted_tags $file >/dev/tty
> + cmd="insert_extracted_tags $file"
> + else
> + tags=$(printf -- "# *** extracted tags ***\n%s" "$tags")
> + cmd="cat ; echo \"$tags\""
> + fi
> + git filter-branch -f --msg-filter "$cmd" $range
> }
>
> function dim_extract_queued
--
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-04-06 11:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-23 21:07 [PATCH dim 1/2] dim: Add support for multiple messages in extract-tags Sean Paul
2017-03-23 21:07 ` [PATCH dim 2/2] dim: Curate and insert tags into patch(es) Sean Paul
2017-03-24 7:54 ` Jani Nikula
2017-03-24 14:04 ` Sean Paul
2017-04-03 21:10 ` [maintainer-tools PATCH v2 " Sean Paul
2017-04-06 11:50 ` Jani Nikula [this message]
2017-04-14 16:43 ` [maintainer-tools PATCH v3 " Sean Paul
2017-03-24 9:07 ` [PATCH dim " Ville Syrjälä
2017-03-24 14:09 ` Sean Paul
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=878tndzre0.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=seanpaul@chromium.org \
--cc=ville.syrjala@linux.intel.com \
/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 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.