git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-quiltimport: add a --series option
@ 2013-12-20 10:21 Wang Nan
  0 siblings, 0 replies; only message in thread
From: Wang Nan @ 2013-12-20 10:21 UTC (permalink / raw)
  To: git; +Cc: Wang Nan

This patch add a --series option to git-quiltimport to allow users to
select the name of series file. This option is an analog of quilt's
QUILT_SERIES environment variable.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
---
 Documentation/git-quiltimport.txt |  5 +++++
 git-quiltimport.sh                | 21 ++++++++++++++++++++-
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/Documentation/git-quiltimport.txt b/Documentation/git-quiltimport.txt
index a356196..39d8e4b 100644
--- a/Documentation/git-quiltimport.txt
+++ b/Documentation/git-quiltimport.txt
@@ -44,6 +44,11 @@ OPTIONS
 --patches <dir>::
 	The directory to find the quilt patches and the
 	quilt series file.
+
+--series <file>::
+	The name of the series file, defaulting to "series". Relative to
+	patches directory unless an absolute path is used.
+
 +
 The default for the patch directory is patches
 or the value of the $QUILT_PATCHES environment
diff --git a/git-quiltimport.sh b/git-quiltimport.sh
index 8e17525..11a97b4 100755
--- a/git-quiltimport.sh
+++ b/git-quiltimport.sh
@@ -6,6 +6,7 @@ git quiltimport [options]
 n,dry-run     dry run
 author=       author name and email address for patches without any
 patches=      path to the quilt series and patches
+series=       name of the series file
 "
 SUBDIRECTORY_ON=Yes
 . git-sh-setup
@@ -26,6 +27,10 @@ do
 		shift
 		QUILT_PATCHES="$1"
 		;;
+	--series)
+		shift
+		QUILT_SERIES="$1"
+		;;
 	--)
 		shift
 		break;;
@@ -52,6 +57,20 @@ if ! [ -d "$QUILT_PATCHES" ] ; then
 	exit 1
 fi
 
+: ${QUILT_SERIES:=series}
+case ${QUILT_SERIES} in
+	/*)
+		QUILT_SERIES_FILE=${QUILT_SERIES}
+	   ;;
+	*)
+		QUILT_SERIES_FILE=${QUILT_PATCHES}/${QUILT_SERIES}
+esac
+
+if ! [ -f "$QUILT_SERIES_FILE" ] ; then
+	echo "The \"$QUILT_SERIES_FILE\" file does not exist."
+	exit 1
+fi
+
 # Temporary directories
 tmp_dir="$GIT_DIR"/rebase-apply
 tmp_msg="$tmp_dir/msg"
@@ -134,5 +153,5 @@ do
 		commit=$( (echo "$SUBJECT"; echo; cat "$tmp_msg") | git commit-tree $tree -p $commit) &&
 		git update-ref -m "quiltimport: $patch_name" HEAD $commit || exit 4
 	fi
-done 3<"$QUILT_PATCHES/series"
+done 3<"$QUILT_SERIES_FILE"
 rm -rf $tmp_dir || exit 5
-- 
1.8.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-12-20 10:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-20 10:21 [PATCH] git-quiltimport: add a --series option Wang Nan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).