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

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


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



More information about the Intel-gfx mailing list