[maintainer-tools PATCH 03/30] qf: Move "setup" 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, with the arguments now shifted.

It seems that the argument for branch_init is useles,
but I will keep it for now to avoid any change
that is not related to the new subcommand scheme.

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 | 61 +++++++++++++++++++++++++++++++------------------------------
 1 file changed, 31 insertions(+), 30 deletions(-)

diff --git a/qf b/qf
index c02fb75a4e3a..0f8c706763f8 100755
--- a/qf
+++ b/qf
@@ -170,36 +170,6 @@ function quilt_clean_check
 }
 
 case "$1" in
-	setup)
-		cd `git rev-parse --show-toplevel`
-
-		if [[ -d patches ]] ; then
-			if [[ ! -d patches/.git ]] ; then
-				echo patches/ directory exists, but not initialized.
-				echo Please fix manually.
-				exit 11
-			fi
-
-			echo Quilt repo already set up.
-		else
-			repo_init
-		fi
-
-
-		if [[ -n $2 ]] ; then
-			if ! git branch | grep $2 &> /dev/null ; then
-				echo $2 is not a branch in the main repo, aborting.
-				exit 13
-			fi
-
-			branch=$2
-			quilt_branch=$QUILT_PREFIX$branch
-			baseline=`git rev-parse $2`
-			remote=`git config branch.$branch.remote`
-
-			branch_init $3
-		fi
-		;;
 	checkout|co)
 		cd_toplevel
 
@@ -470,6 +440,37 @@ else
     shift
 fi
 
+function qf_setup
+{
+	cd `git rev-parse --show-toplevel`
+
+	if [[ -d patches ]] ; then
+		if [[ ! -d patches/.git ]] ; then
+			echo patches/ directory exists, but not initialized.
+			echo Please fix manually.
+			exit 11
+		fi
+
+		echo Quilt repo already set up.
+	else
+		repo_init
+	fi
+
+	if [[ -n $1 ]] ; then
+		if ! git branch | grep $1 &> /dev/null ; then
+			echo $1 is not a branch in the main repo, aborting.
+			exit 13
+		fi
+
+		branch=$1
+		quilt_branch=$QUILT_PREFIX$branch
+		baseline=`git rev-parse $1`
+		remote=`git config branch.$branch.remote`
+
+		branch_init $2
+	fi
+}
+
 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