Skip to content

Commit

Permalink
git-quiltimport: add commandline option --series <file>
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Juerg Haefliger authored and gitster committed Sep 1, 2015
1 parent b260d26 commit ff60ffd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
11 changes: 9 additions & 2 deletions Documentation/git-quiltimport.txt
Expand Up @@ -10,6 +10,7 @@ SYNOPSIS
--------
[verse]
'git quiltimport' [--dry-run | -n] [--author <author>] [--patches <dir>]
[--series <file>]


DESCRIPTION
Expand Down Expand Up @@ -42,13 +43,19 @@ OPTIONS
information can be found in the patch description.

--patches <dir>::
The directory to find the quilt patches and the
quilt series file.
The directory to find the quilt patches.
+
The default for the patch directory is patches
or the value of the $QUILT_PATCHES environment
variable.

--series <file>::
The quilt series file.
+
The default for the series file is <patches>/series
or the value of the $QUILT_SERIES environment
variable.

GIT
---
Part of the linkgit:git[1] suite
16 changes: 14 additions & 2 deletions git-quiltimport.sh
Expand Up @@ -6,7 +6,8 @@ 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
patches= path to the quilt patches
series= path to the quilt series file
"
SUBDIRECTORY_ON=Yes
. git-sh-setup
Expand All @@ -27,6 +28,10 @@ do
shift
QUILT_PATCHES="$1"
;;
--series)
shift
QUILT_SERIES="$1"
;;
--)
shift
break;;
Expand All @@ -53,6 +58,13 @@ if ! [ -d "$QUILT_PATCHES" ] ; then
exit 1
fi

# Quilt series file
: ${QUILT_SERIES:=$QUILT_PATCHES/series}
if ! [ -e "$QUILT_SERIES" ] ; then
echo "The \"$QUILT_SERIES\" file does not exist."
exit 1
fi

# Temporary directories
tmp_dir="$GIT_DIR"/rebase-apply
tmp_msg="$tmp_dir/msg"
Expand Down Expand Up @@ -135,5 +147,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"
rm -rf $tmp_dir || exit 5

0 comments on commit ff60ffd

Please sign in to comment.