[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Quilt-dev] [PATCH] push: patch's --merge option has an optional arg
From: |
Andreas Gruenbacher |
Subject: |
Re: [Quilt-dev] [PATCH] push: patch's --merge option has an optional argument now |
Date: |
Mon, 25 Jan 2010 11:40:52 +0100 |
User-agent: |
KMail/1.12.2 (Linux/2.6.31.8-0.1-desktop; KDE/4.3.1; x86_64; ; ) |
On Monday 25 January 2010 11:28:44 Jean Delvare wrote:
> Hi Bert,
>
> Le samedi 2 janvier 2010 13:33, Bert Wesarg a écrit :
> > Since version 2.6.1 the patch utility knows an optional argument for
> > --merge. Regognize this and pass it on to patch.
> >
> > Signed-off-by: Bert Wesarg <address@hidden>
> >
> > ---
> > quilt/push.in | 21 +++++++++++++++------
> > 1 files changed, 15 insertions(+), 6 deletions(-)
> >
> > diff --git a/quilt/push.in b/quilt/push.in
> > index d89f927..66980c6 100644
> > --- a/quilt/push.in
> > +++ b/quilt/push.in
> > @@ -21,7 +21,7 @@ setup_colors
> >
> > usage()
> > {
> > - printf $"Usage: quilt push [-afqv] [--merge] [--leave-rejects]
> > [--color[=always|auto|never]] [num|patch]\n" + printf $"Usage: quilt
> > push
> > [-afqv] [--merge[=merge|diff3]] [--leave-rejects]
> > [--color[=always|auto|never]] [num|patch]\n" if [ x$1 = x-h ]
> > then
> > printf $"
> > @@ -44,7 +44,7 @@ be used.
> > --fuzz=N
> > Set the maximum fuzz factor (default: 2).
> >
> > --m, --merge
> > +-m, --merge[=merge|diff3]
> > Merge the patch file into the original files (see patch(1)).
> >
> > --leave-rejects
> > @@ -274,7 +274,7 @@ list_patches()
> > fi
> > }
> >
> > -options=`getopt -o fqvamh --long fuzz:,merge,leave-rejects,color:: --
> > "$@"` +options=`getopt -o fqvamh --long
> > fuzz:,merge::,leave-rejects,color:: -- "$@"`
>
> Shouldn't "-o fqvamh" become "-o fqvam::h"?
Yes indeed, thanks.
> > if [ $? -ne 0 ]
> > then
> > @@ -305,8 +305,17 @@ do
> > opt_fuzz=$2
> > shift 2 ;;
> > -m | --merge)
> > - opt_merge=1
> > - shift 1 ;;
> > + case "$2" in
> > + "" | merge)
> > + opt_merge=1
> > + opt_merge_arg= ;;
> > + diff3)
> > + opt_merge=1
> > + opt_merge_arg="=diff3" ;;
> > + *)
> > + usage ;;
> > + esac
> > + shift 2 ;;
>
> Is "shift 2" really OK if the optional argument wasn't provided?
Yes.
Thanks,
Andreas