[PATCH] dim: Add "commit" to end user using dim cite directly

Rodrigo Vivi rodrigo.vivi at intel.com
Fri Oct 5 17:05:14 UTC 2018


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?

Yes, we can... but I just bothered to write this RFC change because this
was not the first time that I faced this need.
Actually 100% of time that I use dim cite I need to write
the word commit.

> 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.

If you read the patch you see that Fixes will continue without
"commit" word.

For fixes we have dim fixes, dim cite is for other mentions, probably
on emails or commit messages where commit word would be helpful.

> 
> > 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>

I agree. Although my actions on day by day as developer are on the lazy
side of things... specially used nowadays with CI doing the checks for me
:(
/me runs

> 
> BR,
> Jani.
> 
> 
> >
> > -: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


More information about the dim-tools mailing list