From: Wang Nan <wangnan0@huawei.com>
To: <git@vger.kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Subject: [PATCH] git-quiltimport: add a --series option
Date: Fri, 20 Dec 2013 18:21:27 +0800 [thread overview]
Message-ID: <1387534887-68321-1-git-send-email-wangnan0@huawei.com> (raw)
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
reply other threads:[~2013-12-20 10:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1387534887-68321-1-git-send-email-wangnan0@huawei.com \
--to=wangnan0@huawei.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).