diff mbox

[maintainer-tools,v2,25/33] dim: abstract dim_cherry_pick

Message ID 80ce6521559a228eb15152aa8e65758925b0ec88.1453985388.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jani Nikula Jan. 28, 2016, 1:27 p.m. UTC
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 dim | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)
diff mbox

Patch

diff --git a/dim b/dim
index 4942b1684f74..69c8d6a49495 100755
--- a/dim
+++ b/dim
@@ -453,6 +453,22 @@  function dim_apply_next_fixes
 	dim_apply_branch drm-intel-next-fixes "$@"
 }
 
+function dim_cherry_pick
+{
+	if [[ "x$1" = "x" ]]; then
+		echo "usage: $0 $subcommand commit-ish"
+		exit 1
+	fi
+	sha=`git rev-parse $1`
+	sha_short=${sha:0:8}
+
+	# need latest -nightly
+	git fetch $DIM_DRM_INTEL_REMOTE
+	echo Possible fixup patches for your cherry-pick:
+	git log --grep=$sha_short --pretty=oneline $sha..$DIM_DRM_INTEL_REMOTE/drm-intel-nightly
+	$DRY git cherry-pick $1
+}
+
 dim_alias_ar=apply-resolved
 function dim_apply_resolved
 {
@@ -915,20 +931,6 @@  fi
 # XXX: abscract each case to a dim_ prefixed function, and turn the help|*) case
 # into an else branch in the above check for functions.
 case "$subcmd" in
-	cherry-pick)
-		if [[ "x$1" = "x" ]]; then
-			echo "usage: $0 $subcommand commit-ish"
-			exit 1
-		fi
-		sha=`git rev-parse $1`
-		sha_short=${sha:0:8}
-
-		# need latest -nightly
-		git fetch $DIM_DRM_INTEL_REMOTE
-		echo Possible fixup patches for your cherry-pick:
-		git log --grep=$sha_short --pretty=oneline $sha..$DIM_DRM_INTEL_REMOTE/drm-intel-nightly
-		$DRY git cherry-pick $1
-		;;
 	pull-request-next)
 		upstream=${1:-$DIM_DRM_UPSTREAM_REMOTE/drm-next}
 		dim_pull_request drm-intel-next $upstream