[Intel-gfx] [maintainer-tools PATCH 09/30] qf: Move "push" from case to new subcommand.

Rodrigo Vivi rodrigo.vivi at intel.com
Mon Aug 21 20:10:59 UTC 2017


No functional change. Only moving from the case
to its own function.

Cc: Jani Nikula <jani.nikula at intel.com>
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
---
 qf | 56 +++++++++++++++++++++++++++++---------------------------
 1 file changed, 29 insertions(+), 27 deletions(-)

diff --git a/qf b/qf
index d9650f44e370..1e5594eaf223 100755
--- a/qf
+++ b/qf
@@ -170,33 +170,6 @@ function quilt_clean_check
 }
 
 case "$1" in
-	push)
-		cd_toplevel
-		repo_check 0
-		quilt_clean_check
-
-		remote=`git config branch.$branch.remote`
-
-		export_quilt_sha=`git notes --ref=quilt show $branch | grep Quilt-Commit | cut -d ' ' -f 2`
-		quilt_sha=`cd patches ; git rev-parse $quilt_branch`
-
-		if [[ $export_quilt_sha != $quilt_sha ]] ; then
-			echo Quilt export is out of date, aborting
-			echo $export_quilt_sha
-			echo $quilt_sha
-			exit 18
-		fi
-
-		cd patches
-		git push $remote $quilt_branch:refs/quilts/$branch
-		cd ..
-
-		# The exported branch is a rebasing one, so force the push.
-		# Everything else shouldn't ever need a force-push.
-		git push $remote $branch -f
-
-		git push $remote refs/baselines/$branch/*:refs/baselines/$branch/*
-		;;
 	fetch)
 		cd_toplevel
 		repo_check 0
@@ -483,6 +456,35 @@ function qf_export_visualize
 	gitk QUILT_EXPORT ^$baseline
 }
 
+function qf_push
+{
+	cd_toplevel
+	repo_check 0
+	quilt_clean_check
+
+	remote=`git config branch.$branch.remote`
+
+	export_quilt_sha=`git notes --ref=quilt show $branch | grep Quilt-Commit | cut -d ' ' -f 2`
+	quilt_sha=`cd patches ; git rev-parse $quilt_branch`
+
+	if [[ $export_quilt_sha != $quilt_sha ]] ; then
+		echo Quilt export is out of date, aborting
+		echo $export_quilt_sha
+		echo $quilt_sha
+		exit 18
+	fi
+
+	cd patches
+	git push $remote $quilt_branch:refs/quilts/$branch
+	cd ..
+
+	# The exported branch is a rebasing one, so force the push.
+	# Everything else shouldn't ever need a force-push.
+	git push $remote $branch -f
+
+	git push $remote refs/baselines/$branch/*:refs/baselines/$branch/*
+}
+
 function qf_help
 {
 	manpage=$DIM_PREFIX/maintainer-tools/qf.rst
-- 
2.13.2



More information about the Intel-gfx mailing list