{"thread":{"id":"35556","subject":"[PATCH] git-quiltimport: add a --series option","startedAt":"2013-12-20T10:21:27Z","lastAt":"2013-12-20T10:21:27Z","messageCount":1,"participants":["Wang Nan"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"232282","messageId":"1387534887-68321-1-git-send-email-wangnan0@huawei.com","threadId":"35556","inReplyTo":null,"subject":"[PATCH] git-quiltimport: add a --series option","fromName":"Wang Nan","fromEmail":"wangnan0@huawei.com","sentAt":"2013-12-20T10:21:27Z","receivedAt":"2013-12-20T10:21:27Z","isPatch":true,"sender":{"key":"wangnan0@huawei.com","avatar":null},"body":"This patch add a --series option to git-quiltimport to allow users to\nselect the name of series file. This option is an analog of quilt's\nQUILT_SERIES environment variable.\n\nSigned-off-by: Wang Nan <wangnan0@huawei.com>\n---\n Documentation/git-quiltimport.txt |  5 +++++\n git-quiltimport.sh                | 21 ++++++++++++++++++++-\n 2 files changed, 25 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-quiltimport.txt b/Documentation/git-quiltimport.txt\nindex a356196..39d8e4b 100644\n--- a/Documentation/git-quiltimport.txt\n+++ b/Documentation/git-quiltimport.txt\n@@ -44,6 +44,11 @@ OPTIONS\n --patches <dir>::\n \tThe directory to find the quilt patches and the\n \tquilt series file.\n+\n+--series <file>::\n+\tThe name of the series file, defaulting to \"series\". Relative to\n+\tpatches directory unless an absolute path is used.\n+\n +\n The default for the patch directory is patches\n or the value of the $QUILT_PATCHES environment\ndiff --git a/git-quiltimport.sh b/git-quiltimport.sh\nindex 8e17525..11a97b4 100755\n--- a/git-quiltimport.sh\n+++ b/git-quiltimport.sh\n@@ -6,6 +6,7 @@ git quiltimport [options]\n n,dry-run     dry run\n author=       author name and email address for patches without any\n patches=      path to the quilt series and patches\n+series=       name of the series file\n \"\n SUBDIRECTORY_ON=Yes\n . git-sh-setup\n@@ -26,6 +27,10 @@ do\n \t\tshift\n \t\tQUILT_PATCHES=\"$1\"\n \t\t;;\n+\t--series)\n+\t\tshift\n+\t\tQUILT_SERIES=\"$1\"\n+\t\t;;\n \t--)\n \t\tshift\n \t\tbreak;;\n@@ -52,6 +57,20 @@ if ! [ -d \"$QUILT_PATCHES\" ] ; then\n \texit 1\n fi\n \n+: ${QUILT_SERIES:=series}\n+case ${QUILT_SERIES} in\n+\t/*)\n+\t\tQUILT_SERIES_FILE=${QUILT_SERIES}\n+\t   ;;\n+\t*)\n+\t\tQUILT_SERIES_FILE=${QUILT_PATCHES}/${QUILT_SERIES}\n+esac\n+\n+if ! [ -f \"$QUILT_SERIES_FILE\" ] ; then\n+\techo \"The \\\"$QUILT_SERIES_FILE\\\" file does not exist.\"\n+\texit 1\n+fi\n+\n # Temporary directories\n tmp_dir=\"$GIT_DIR\"/rebase-apply\n tmp_msg=\"$tmp_dir/msg\"\n@@ -134,5 +153,5 @@ do\n \t\tcommit=$( (echo \"$SUBJECT\"; echo; cat \"$tmp_msg\") | git commit-tree $tree -p $commit) &&\n \t\tgit update-ref -m \"quiltimport: $patch_name\" HEAD $commit || exit 4\n \tfi\n-done 3<\"$QUILT_PATCHES/series\"\n+done 3<\"$QUILT_SERIES_FILE\"\n rm -rf $tmp_dir || exit 5\n-- \n1.8.4\n"}]}