Re: [PATCH v8 2/4] cat-file: teach cat-file a '--literally' option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 20, 2015, 05:30 UTC
- Message-ID
- <xmqq7ft7nz8l.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <20150419002807.GA11634@hashpling.org>
Charles Bailey <charles@hashpling.org> writes:
Show 7 quoted lines
> I'm sorry to come in with such a fundamental question at such a late > revision of this patch series, but am I the only person to wonder about > the choice of option name? > > To me, cat-file already output objects "literally" (without -p) as > opposed to show. From the description, it feels more like it should be > "--unchecked" or perhaps something better that I haven't thought of?
Yeah, it was conceived as a way to grok what hash-object --literally would create, but the operation by "cat-file --literally" is not about showing the contents literally without interpreting (the general "cat-file <type> <objectname>" does the literal output already). So it was my fault to suggest that name, but I do not think of a better alternative.
> The option isn't a true opposite of hash-object's --literally because > that also allows the creation of known types with invalid contents (e.g. > corrupt trees) whereas cat-file is quite happy to show the _contents_ of > such corrupt objects even without --literally.
Not really. If you create an object with corrupt type string (e.g. "BLOB" instead of "blob"), cat-file would not be happy.