Re: [PATCH 5/7] archive: refactor format-guessing from filename
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 15, 2011, 23:48 UTC
- Message-ID
- <7vmxhiirlb.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20110615223407.GE16807@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 17 quoted lines
> But more important is that the name hint is only a hint, and
> we default to the tar format. Which means that
> inconsistencies between the client's and server's set of
> formats will have confusing results. For example, imagine
> the client learns about "tar.gz" as an extension for gzip'd
> tar ("tgz") files, but the server does not. Locally,
> running:
>
> git archive -o file.tar.gz HEAD
>
> will produce a gzip'd file. If we make the mapping decision
> locally, then running:
>
> git archive --remote=origin -o file.tar.gz HEAD
>
> will send "--format=tgz" to the remote side. The server will
> complain, saying that it doesn't know about the tgz format.As long as that complaint is clearly marked as coming from the remote side, the user now knows that tgz is not supported, and can fall back to a plain tar.
Am I being naïve thinking that barfing (and assuming that the user understands why the remote end barfed) actually is a good thing?