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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Cc: Jani Nikula <jani.nikula@xxxxxxxxx>
Cc: Daniel Vetter <daniel.vetter@xxxxxxxx>
Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>
---
 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

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




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux