All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [maintainer-tools RFC PATCH] dim: add cherry-pick-[next-]fixes subcommands
Date: Wed, 17 Feb 2016 14:58:21 +0200	[thread overview]
Message-ID: <87twl7xzma.fsf@intel.com> (raw)
In-Reply-To: <20160210081439.GN11240@phenom.ffwll.local>

On Wed, 10 Feb 2016, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Fri, Jan 29, 2016 at 09:40:32AM +0200, Jani Nikula wrote:
>> Add two new subcommands for cherry-picking fixes from dinq to
>> drm-intel-fixes and drm-intel-next-fixes. The only difference in the
>> subcommands is the assert branch check to ensure the user is on the
>> right branch.
>> 
>> The commands scan dinq for commits Cc'd to stable or drm-intel-fixes,
>> checks whether they've already been backported, attempts cherry-pick,
>> and asks for directions on failed cherry-pick.
>> 
>> It's still rough around the edges and slow as molasses due to unlimited
>> scan for backports (should just check a release or two back at most),
>> and an aborted run just starts over next time (though it should take the
>> freshly backported commits into account).
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> 
>> ---
>> 
>> Undecided whether we should apply this already or not. It's crude, but I
>> use it.
>
> Imo add help text and push it. We can prettify later on. Oh and maybe bash
> completion too. Wrt speeding this up, have you looked at gregkh's
> toolchaing for stable kernels? It should be out there somewhere.

Added help and pushed.

BR,
Jani.


> -Daniel
>
>> ---
>>  dim | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 49 insertions(+)
>> 
>> diff --git a/dim b/dim
>> index 203c6b60cf1b..c64f6e86af62 100755
>> --- a/dim
>> +++ b/dim
>> @@ -473,6 +473,55 @@ function dim_cherry_pick
>>  	$DRY git cherry-pick $1
>>  }
>>  
>> +function dim_cherry_pick_branch
>> +{
>> +	for commit in $(git log --reverse --format=format:%h --grep="drm-intel-fixes@lists.freedesktop.org" --grep="stable@vger.kernel.org" origin/master..$DIM_DRM_INTEL_REMOTE/drm-intel-next-queued -- drivers/gpu/drm/i915); do
>> +		echo "Considering $(git --no-pager log --oneline -1 $commit)"
>> +		log=$(mktemp)
>> +		# note *local* branches to account for unpushed ones
>> +		git log drm-intel-fixes --oneline --grep="cherry picked .* $commit" > $log
>> +		git log drm-intel-next-fixes --oneline --grep="cherry picked .* $commit" >> $log
>> +		if [ "$(cat $log)" = "" ]; then
>> +			if ! git cherry-pick -e -x -s $commit; then
>> +				select choice in "Diff" "Resolve" "Skip" "Abort"; do
>> +					case $choice in
>> +						Diff)
>> +							git diff
>> +							;;
>> +						Resolve)
>> +							exit
>> +							;;
>> +						Skip)
>> +							git cherry-pick --abort
>> +							break
>> +							;;
>> +						Abort)
>> +							git cherry-pick --abort
>> +							exit
>> +							;;
>> +					esac
>> +				done
>> +			fi
>> +		else
>> +			echo "Already backported as:"
>> +			sed 's/^/\t/' < $log
>> +		fi
>> +		rm -f $log
>> +	done
>> +}
>> +
>> +function dim_cherry_pick_fixes
>> +{
>> +	assert_branch drm-intel-fixes
>> +	dim_cherry_pick_branch "$@"
>> +}
>> +
>> +function dim_cherry_pick_next_fixes
>> +{
>> +	assert_branch drm-intel-next-fixes
>> +	dim_cherry_pick_branch "$@"
>> +}
>> +
>>  dim_alias_ar=apply-resolved
>>  function dim_apply_resolved
>>  {
>> -- 
>> 2.1.4
>> 

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2016-02-17 12:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29  7:40 [maintainer-tools RFC PATCH] dim: add cherry-pick-[next-]fixes subcommands Jani Nikula
2016-02-10  8:14 ` Daniel Vetter
2016-02-17 12:58   ` Jani Nikula [this message]

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=87twl7xzma.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=daniel@ffwll.ch \
    --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.