git-quiltimport: add commandline option --series <file>
The quilt series file doesn't have to be located in the same directory with the patches and can be named differently than 'series' as well. This patch adds a commandline option to allow for a non-standard series filename and location. Signed-off-by: Juerg Haefliger <juerg.haefliger@hp.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Juerg Haefliger committed
Aug 31, 2015 at 14:06 UTC
ff60ffdc05fe8e2d26c488ab18c66b7fa746fcc6
2 files changed
+23
-4
Documentation/git-quiltimport.txt
+9
-2
@@ -10,6 +10,7 @@ SYNOPSIS
10
--------
11
[verse]
12
'git quiltimport' [--dry-run | -n] [--author <author>] [--patches <dir>]
13
+ [--series <file>]
14
15
16
DESCRIPTION
@@ -42,13 +43,19 @@ OPTIONS
43
information can be found in the patch description.
44
45
--patches <dir>::
45
- The directory to find the quilt patches and the
46
- quilt series file.
46
+ The directory to find the quilt patches.
47
+
48
The default for the patch directory is patches
49
or the value of the $QUILT_PATCHES environment
50
variable.
51
52
+--series <file>::
53
+ The quilt series file.
54
++
55
+The default for the series file is <patches>/series
56
+or the value of the $QUILT_SERIES environment
57
+variable.
58
+
59
GIT
60
---
61
Part of the linkgit:git[1] suite
git-quiltimport.sh
+14
-2
@@ -6,7 +6,8 @@ git quiltimport [options]
6
--
7
n,dry-run dry run
8
author= author name and email address for patches without any
9
-patches= path to the quilt series and patches
9
+patches= path to the quilt patches
10
+series= path to the quilt series file
11
"
12
SUBDIRECTORY_ON=Yes
13
. git-sh-setup
@@ -27,6 +28,10 @@ do
28
shift
29
QUILT_PATCHES="$1"
30
;;
31
+ --series)
32
+ shift
33
+ QUILT_SERIES="$1"
34
+ ;;
35
--)
36
shift
37
break;;
@@ -53,6 +58,13 @@ if ! [ -d "$QUILT_PATCHES" ] ; then
58
exit 1
59
fi
60
61
+# Quilt series file
62
+: ${QUILT_SERIES:=$QUILT_PATCHES/series}
63
+if ! [ -e "$QUILT_SERIES" ] ; then
64
+ echo "The \"$QUILT_SERIES\" file does not exist."
65
+ exit 1
66
+fi
67
+
68
# Temporary directories
69
tmp_dir="$GIT_DIR"/rebase-apply
70
tmp_msg="$tmp_dir/msg"
@@ -135,5 +147,5 @@ do
147
commit=$( (echo "$SUBJECT"; echo; cat "$tmp_msg") | git commit-tree $tree -p $commit) &&
148
git update-ref -m "quiltimport: $patch_name" HEAD $commit || exit 4
149
fi
138
-done 3<"$QUILT_PATCHES/series"
150
+done 3<"$QUILT_SERIES"
151
rm -rf $tmp_dir || exit 5