Merge branch 'jh/quiltimport-explicit-series-file'

"quiltimport" allows to specify the series file by honoring the
$QUILT_SERIES environment and also --series command line option.

* jh/quiltimport-explicit-series-file:
  git-quiltimport: add commandline option --series <file>
This commit is contained in:
Junio C Hamano 2015-10-05 12:30:08 -07:00
commit db9789ab4e
2 changed files with 23 additions and 4 deletions

View File

@ -10,6 +10,7 @@ SYNOPSIS
-------- --------
[verse] [verse]
'git quiltimport' [--dry-run | -n] [--author <author>] [--patches <dir>] 'git quiltimport' [--dry-run | -n] [--author <author>] [--patches <dir>]
[--series <file>]
DESCRIPTION DESCRIPTION
@ -42,13 +43,19 @@ OPTIONS
information can be found in the patch description. information can be found in the patch description.
--patches <dir>:: --patches <dir>::
The directory to find the quilt patches and the The directory to find the quilt patches.
quilt series file.
+ +
The default for the patch directory is patches The default for the patch directory is patches
or the value of the $QUILT_PATCHES environment or the value of the $QUILT_PATCHES environment
variable. 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 GIT
--- ---
Part of the linkgit:git[1] suite Part of the linkgit:git[1] suite

View File

@ -6,7 +6,8 @@ git quiltimport [options]
-- --
n,dry-run dry run n,dry-run dry run
author= author name and email address for patches without any 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 SUBDIRECTORY_ON=Yes
. git-sh-setup . git-sh-setup
@ -27,6 +28,10 @@ do
shift shift
QUILT_PATCHES="$1" QUILT_PATCHES="$1"
;; ;;
--series)
shift
QUILT_SERIES="$1"
;;
--) --)
shift shift
break;; break;;
@ -53,6 +58,13 @@ if ! [ -d "$QUILT_PATCHES" ] ; then
exit 1 exit 1
fi 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 # Temporary directories
tmp_dir="$GIT_DIR"/rebase-apply tmp_dir="$GIT_DIR"/rebase-apply
tmp_msg="$tmp_dir/msg" tmp_msg="$tmp_dir/msg"
@ -135,5 +147,5 @@ do
commit=$( (echo "$SUBJECT"; echo; cat "$tmp_msg") | git commit-tree $tree -p $commit) && commit=$( (echo "$SUBJECT"; echo; cat "$tmp_msg") | git commit-tree $tree -p $commit) &&
git update-ref -m "quiltimport: $patch_name" HEAD $commit || exit 4 git update-ref -m "quiltimport: $patch_name" HEAD $commit || exit 4
fi fi
done 3<"$QUILT_PATCHES/series" done 3<"$QUILT_SERIES"
rm -rf $tmp_dir || exit 5 rm -rf $tmp_dir || exit 5