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 <wangn...@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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to