-=| Guido Günther, Tue, Jun 09, 2009 at 09:21:00AM +0200 |=-
> On Fri, Jun 05, 2009 at 05:14:06PM +0300, Damyan Ivanov wrote:
> > Package: git-buildpackage
> > Version: 0.4.53
> > Severity: normal
> > Tags: patch
> > 
> > Hi,
> > 
> > If there is some commit that starts with dashes, git-dch calls dch like 
> > this:
> > 
> >   dch <options> '--some message starting with dashes'
> That's bad.
> 
> > the message is interpreted by dch as an option, leading to failure to parse 
> > command-line options.
> > 
> > Adding '--' argument before the message fixes this. Patch attached.
> -- doesn't seem to be documented in the manpage. Do you know if dch
> supports this since ages? Otherwise we'd have to add a versioned
> dependency.

I have checked the first SVN revision of debchange.pl (devscripts 
package) from 2004 and it uses the Getopt::Long Perl module (from 
perl-base package) for parsing command line options, which has '--' 
documented:

    Mixing command line option with other arguments
        Usually programs take command line options as well as other 
        arguments, for example, file names. It is good practice to 
        always specify the options first, and the other arguments 
        last. Getopt::Long will, however, allow the options and 
        arguments to be mixed and ’filter out’ all the options before 
        passing the rest of the arguments to the program. To stop 
        Getopt::Long from processing further arguments, insert 
        a double dash "--" on the command line:

            --size 24 -- --all

        In this example, "--all" will not be treated as an option, but 
        passed to the program unharmed, in @ARGV.

Getopt::Long's CHANGES[1] file doesn't mention when '--' was initially 
implemented, but mentions a bug related to '--' being fixed in release 
2.33. perl-base in oldstable has release 2.35 of the module, so 
I guess no special dependency is needed whatsoever.

    [0] http://cpansearch.perl.org/src/JV/Getopt-Long-2.38/CHANGES


Thanks for carying.

-- 
dam

Attachment: signature.asc
Description: Digital signature

Reply via email to