From: Jani Nikula <jani.nikula@intel.com>
To: Imre Deak <imre.deak@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [maintainer-tools PATCH] dim: Check for required tags before pushing a branch
Date: Thu, 03 Mar 2016 10:11:48 +0200 [thread overview]
Message-ID: <87povcrnej.fsf@intel.com> (raw)
In-Reply-To: <1456932222-26116-1-git-send-email-imre.deak@intel.com>
On Wed, 02 Mar 2016, Imre Deak <imre.deak@intel.com> wrote:
> Check if the committer's and author's Signed-off-by line and at least
> one Reviewed-by line exists in each commit to be pushed.
>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
> dim | 32 ++++++++++++++++++++++++++++++++
> 1 file changed, 32 insertions(+)
>
> diff --git a/dim b/dim
> index 1addd6f..b951fb4 100755
> --- a/dim
> +++ b/dim
> @@ -361,6 +361,37 @@ function dim_nightly_forget
> git rerere forget
> }
>
> +function assert_one_commit_tag
> +{
> + local commit_message="$1"
> + local tag="$2"
> +
> + if ! echo "$commit_message" | grep -q "^$tag"; then
I think you'll find this is too strict. There may be subtle differences
in the author (which comes from the patch email From: header) and
signed-off-by lines.
> + echo "Tag '$tag' missing from $commit"
> + return 1
> + fi
> +
> +}
> +
> +function assert_all_commit_tags
> +{
> + local branch=$1
> + local new_commits=$(git rev-list $DIM_DRM_INTEL_REMOTE/$branch..$branch)
> +
> + local commit
> + for commit in $new_commits; do
> + local commit_message=$(git show -s --format=%B $commit)
> + local committer_email=$(git show -s --format="%cn <%ce>" $commit)
> + local author_email=$(git show -s --format="%an <%ae>" $commit)
> +
> + assert_one_commit_tag "$commit_message" "Signed-off-by: $author_email"
> + assert_one_commit_tag "$commit_message" "Signed-off-by: $committer_email"
> + assert_one_commit_tag "$commit_message" "Reviewed-by: .\+ <.\+@.\+>"
If you write a patch and I review and push it, I won't add an extra
reviewed-by, just a signed-off-by.
> + done
> +
> + return 0
> +}
> +
> # push branch $1, rebuild nightly. the rest of the arguments are passed to git
> # push.
> function dim_push_branch
> @@ -374,6 +405,7 @@ function dim_push_branch
> shift
>
> assert_branch $branch
> + assert_all_commit_tags $branch
This should be added to the checkpatch part instead of push. First, we
need to push a lot of non-i915 stuff when rebasing fixes or pushing
backmerges. Second, it is useful to be able to non-intrusively check
this before pushing.
BR,
Jani.
>
> git push $DRY_RUN $DIM_DRM_INTEL_REMOTE $branch "$@"
--
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:[~2016-03-03 8:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-02 15:23 [maintainer-tools PATCH] dim: Check for required tags before pushing a branch Imre Deak
2016-03-03 8:11 ` Jani Nikula [this message]
2016-03-03 10:13 ` Imre Deak
2016-03-03 12:18 ` Jani Nikula
2016-03-03 16:30 ` [maintainer-tools PATCH v2] dim: Check for required tags as part of dim_checkpatch Imre Deak
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=87povcrnej.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=imre.deak@intel.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 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.