All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [maintainer-tools RFC PATCH] dim: add cherry-pick-[next-]fixes subcommands
Date: Fri, 29 Jan 2016 09:40:32 +0200	[thread overview]
Message-ID: <1454053232-8894-1-git-send-email-jani.nikula@intel.com> (raw)

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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2016-01-29  7:40 UTC|newest]

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

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=1454053232-8894-1-git-send-email-jani.nikula@intel.com \
    --to=jani.nikula@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.