Re: [RFC/PATCH] archive: "--list" does not take further options
- From
Jeff King <peff@peff.net>
- Date
- Dec 21, 2023, 08:59 UTC
- Message-ID
- <20231221085948.GD545870@coredump.intra.peff.net>
- In-Reply-To
- <296e8d69-c1d7-4ad2-943a-dfc54940abc2@web.de>
On Thu, Dec 21, 2023 at 08:30:36AM +0100, René Scharfe wrote:
Show 11 quoted lines
> > I do not like the remote error behaviour this one adds at all. > > Do we use a more proper mechanism to propagate a remote error > > back for other subcommands we can reuse here? > > Don't we have one? It would affect other unsupported options as well, > and this seems to work just fine, e.g.: > > $ git archive --remote=. --format=foo HEAD > remote: fatal: Unknown archive format 'foo' > remote: git upload-archive: archiver died with error > fatal: sent error to the client: git upload-archive: archiver died with error
Right. The whole idea of upload-archive is to spawn a separate writer process and mux the conversation (including errors) back over the wire. There are a zillion reasons it can die (including bad arguments) and we catch and report them in the muxing process.
Show 10 quoted lines
> > if (list) {
> > + if (argc) {
> > + if (!is_remote)
> > + die(_("extra command line parameter '%s'"), *argv);
> > + else
> > + printf("!ERROR! extra command line parameter '%s'\n",
> > + *argv);
> > + }
>
> So just call die() here?Yes, exactly.
-Peff