Re: `git bundle create -` may not write to `stdout`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 03, 2023 at 08:28:36PM -0500, Jeff King wrote:

> > Given that the other three subcommands also take <file>
> > 
> >     'git bundle' create [-q | --quiet | --progress | --all-progress] ...
> >                         [--version=<version>] <file> <git-rev-list-args>
> >     'git bundle' verify [-q | --quiet] <file>
> >     'git bundle' list-heads <file> [<refname>...]
> >     'git bundle' unbundle [--progress] <file> [<refname>...]
> > 
> > but read_bundle_header() function all three calls begins like so:
> > 
> >     int read_bundle_header(const char *path, struct bundle_header *header)
> >     {
> >             int fd = open(path, O_RDONLY);
> > 
> >             if (fd < 0)
> >                     return error(_("could not open '%s'"), path);
> >             return read_bundle_header_fd(fd, header, path);
> >     }
> > 
> > this function needs to be fixed first ;-)
> 
> I wasn't thinking of changing the behavior for input, but just focusing
> the docs in the right spot (the "create" option), like:

Oh, hmph. I didn't realize that both my patch and yours are touching a
shared options-parser that affects both reading and writing. So the
patch by itself is fixing "git bundle create -" but breaking "git bundle
verify -". We either need to teach the reading side to handle "-", or we
have to teach parse_options_cmd_bundle() to handle the two cases
differently.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux