[PATCH] dim: Add "commit" to end user using dim cite directly
Jani Nikula
jani.nikula at intel.com
Fri Oct 5 08:54:29 UTC 2018
On Fri, 05 Oct 2018, Daniel Vetter <daniel at ffwll.ch> wrote:
> On Fri, Oct 05, 2018 at 10:31:54AM +0300, Jani Nikula wrote:
>> On Thu, 04 Oct 2018, Rodrigo Vivi <rodrigo.vivi at intel.com> wrote:
>> > Internal use of dim_cite doesn't need the "commit" word,
>> > but dim cite is marked as a developer command and developers
>> > using this command probably want to cite the commit to copy
>> > and paste the exact style that kernel request when mentioning
>> > another commit.
>>
>> Can we please keep it as it is? I specifically do *not* want the
>> "commit" text fluff most of the time.
>>
>> The Fixes: line is *not* supposed to have the "commit" text; checkpatch
>> won't complain about that either.
>>
>> > And if lazy guys like me end up forgetting to add the word
>> > commit the CI will complain:
>>
>> I'm more concerned about people not running checkpatch and sparse before
>> submitting patches. Really. Sure we can throw more hardware at CI doing
>> this, but it pollutes human inboxes for no good reason. We should
>> encourage people to get the v1-v2 of patches right instead of rushing it
>> repeatedly, ending up with double digit patch versions. </rant>
>
> gitlab has this neat feature where you can mark up a merge request as WIP
> and then it never pollutes anything, except your own inbox. Also, for any
> CI checks that we don't need real hw for (i.e. stuff that can run on the
> generic gitlab ci runners, like patchwork) you don't even need a merge
> request, you can just push it to your own personal fork.
>
> Asking humans to not be lazy otoh is about as effective as tilting
> windmills. At least in my experience.
Oh, but you're still asking people to push and wait for results before
sending to the mailing list...
BR,
Jani.
>
> Note: None of this requires that we do review in gitlab, just in case it
> looks like I'm advertising for that :-)
>
> Cheers, Daniel
>
>> > -:9: ERROR:GIT_COMMIT_ID: Please use git commit description style
>> > 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 7fe78985cd08
>> > ("drm/i915/csr: restructure CSR firmware definition macros")'
>> > v3: Rebase by Rodrigo after 7fe78985cd08 ("drm/i915/csr: restructure CSR
>> >
>> > Reference: https://patchwork.freedesktop.org/series/49678/
>> > Cc: Jani Nikula <jani.nikula at intel.com>
>> > Cc: Paulo Zanoni <paulo.r.zanoni at intel.com>
>> > Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
>> > ---
>> > dim | 23 ++++++++++++++---------
>> > 1 file changed, 14 insertions(+), 9 deletions(-)
>> >
>> > diff --git a/dim b/dim
>> > index 72c86db560a7..07dd8efac850 100755
>> > --- a/dim
>> > +++ b/dim
>> > @@ -1216,6 +1216,14 @@ function git_list_fixes
>> > "$@"
>> > }
>> >
>> > +function commit_cite
>> > +{
>> > + cd $DIM_PREFIX/$DIM_REPO
>> > +
>> > + git log -1 $1 "--pretty=format:%H (\"%s\")%n" | \
>> > + sed -e 's/\([0-f]\{12\}\)[0-f]*/\1/'
>> > +}
>> > +
>> > function cherry_pick_branch
>> > {
>> > local branch log fail_log intel_remote needed have_fixes
>> > @@ -1228,7 +1236,7 @@ function cherry_pick_branch
>> >
>> > # Look for commits in dinq tagged as fixes.
>> > for commit in $(git_list_fixes $intel_remote/$branch..$intel_remote/drm-intel-next-queued -- drivers/gpu/drm/i915); do
>> > - echo -n "Considering $(dim_cite $commit)... "
>> > + echo -n "Considering $(commit_cite $commit)... "
>> >
>> > # Look at history for already cherry-picked fixes.
>> > # Note: use *local* branches to account for unpushed commits.
>> > @@ -1255,7 +1263,7 @@ function cherry_pick_branch
>> >
>> > # FIXME: see if the commit to be fixed has been
>> > # backported!
>> > - echo -n "Fixes: $(dim_cite $fixes). "
>> > + echo -n "Fixes: $(commit_cite $fixes). "
>> > if [[ "$(git merge-base $branch $fixes)" = "$fixes" ]]; then
>> > needed=1
>> > fi
>> > @@ -1270,8 +1278,8 @@ function cherry_pick_branch
>> > echo "Try to cherry-pick."
>> > commit_list_references $commit
>> > if ! git cherry-pick -x -s $commit; then
>> > - echo "FAILED: $(dim_cite $commit)"
>> > - (dim_cite $commit) >> $fail_log
>> > + echo "FAILED: $(commit_cite $commit)"
>> > + (commit_cite $commit) >> $fail_log
>> > git cherry-pick --abort
>> > fi
>> > done
>> > @@ -2253,10 +2261,7 @@ function dim_cite
>> >
>> > sha1=${1:?$usage}
>> >
>> > - cd $DIM_PREFIX/$DIM_REPO
>> > -
>> > - git log -1 $sha1 "--pretty=format:%H (\"%s\")%n" | \
>> > - sed -e 's/\([0-f]\{12\}\)[0-f]*/\1/'
>> > + echo "commit $(commit_cite $sha1)"
>> > }
>> >
>> > function dim_fixes
>> > @@ -2266,7 +2271,7 @@ function dim_fixes
>> > sha1=${1:?$usage}
>> >
>> > cd $DIM_PREFIX/$DIM_REPO
>> > - echo "Fixes: $(dim_cite $sha1)"
>> > + echo "Fixes: $(commit_cite $sha1)"
>> >
>> > (
>> > git show --no-patch $sha1 | \
>>
>> --
>> Jani Nikula, Intel Open Source Graphics Center
>> _______________________________________________
>> dim-tools mailing list
>> dim-tools at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dim-tools
--
Jani Nikula, Intel Open Source Graphics Center
More information about the dim-tools
mailing list