git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-quiltimport: add commandline option --series <file>
@ 2015-08-31 12:06 Juerg Haefliger
  2015-09-01 18:16 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Juerg Haefliger @ 2015-08-31 12:06 UTC (permalink / raw)
  To: git

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>
---
 Documentation/git-quiltimport.txt | 11 +++++++++--
 git-quiltimport.sh                | 16 ++++++++++++++--
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/Documentation/git-quiltimport.txt b/Documentation/git-quiltimport.txt
index d64388c..ff633b0 100644
--- a/Documentation/git-quiltimport.txt
+++ b/Documentation/git-quiltimport.txt
@@ -10,6 +10,7 @@ SYNOPSIS
 --------
 [verse]
 'git quiltimport' [--dry-run | -n] [--author <author>] [--patches <dir>]
+		[--series <file>]
 
 
 DESCRIPTION
@@ -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
diff --git a/git-quiltimport.sh b/git-quiltimport.sh
index 167d79f..6d3a88d 100755
--- a/git-quiltimport.sh
+++ b/git-quiltimport.sh
@@ -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
@@ -27,6 +28,10 @@ do
 		shift
 		QUILT_PATCHES="$1"
 		;;
+	--series)
+		shift
+		QUILT_SERIES="$1"
+		;;
 	--)
 		shift
 		break;;
@@ -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"
@@ -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
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] git-quiltimport: add commandline option --series <file>
  2015-08-31 12:06 [PATCH] git-quiltimport: add commandline option --series <file> Juerg Haefliger
@ 2015-09-01 18:16 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2015-09-01 18:16 UTC (permalink / raw)
  To: Juerg Haefliger; +Cc: git

Juerg Haefliger <juerg.haefliger@hp.com> writes:

> 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>
> ---
>  Documentation/git-quiltimport.txt | 11 +++++++++--
>  git-quiltimport.sh                | 16 ++++++++++++++--
>  2 files changed, 23 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/git-quiltimport.txt b/Documentation/git-quiltimport.txt
> index d64388c..ff633b0 100644
> --- a/Documentation/git-quiltimport.txt
> +++ b/Documentation/git-quiltimport.txt
> @@ -10,6 +10,7 @@ SYNOPSIS
>  --------
>  [verse]
>  'git quiltimport' [--dry-run | -n] [--author <author>] [--patches <dir>]
> +		[--series <file>]
>  
>  
>  DESCRIPTION
> @@ -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.
> +

Makes sense.

I am not a quilt user, but the Internet finds pages like
http://lists.gnu.org/archive/html/quilt-dev/2009-12/msg00021.html
and http://www.man-online.org/page/1-quilt/, both of which tell me
that QUILT_SERIES is an environment variable that has established
meaning, and the new use in this patch is consistent with the
established practice.

Thanks, will apply.

>  GIT
>  ---
>  Part of the linkgit:git[1] suite
> diff --git a/git-quiltimport.sh b/git-quiltimport.sh
> index 167d79f..6d3a88d 100755
> --- a/git-quiltimport.sh
> +++ b/git-quiltimport.sh
> @@ -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
> @@ -27,6 +28,10 @@ do
>  		shift
>  		QUILT_PATCHES="$1"
>  		;;
> +	--series)
> +		shift
> +		QUILT_SERIES="$1"
> +		;;
>  	--)
>  		shift
>  		break;;
> @@ -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"
> @@ -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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-01 18:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-31 12:06 [PATCH] git-quiltimport: add commandline option --series <file> Juerg Haefliger
2015-09-01 18:16 ` Junio C Hamano

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).