From: karthik nayak <karthik.188@gmail.com>
To: Junio C Hamano <gitster@pobox.com>, Duy Nguyen <pclouds@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [RFC] git cat-file "literally" option
Date: Thu, 19 Feb 2015 15:40:52 +0530 [thread overview]
Message-ID: <54E5B6AC.3030706@gmail.com> (raw)
In-Reply-To: <CAPc5daUWTRA=cziUsXEbwNrggA_3mhRsrfnVaQ-F7iEeSO7ATw@mail.gmail.com>
On 02/18/2015 07:28 PM, Duy Nguyen wrote:> On Wed, Feb 18, 2015 at 7:50
> Use what sha1_object_info() uses behind the scene. Loose object
> encodes object type as a string, you could just print that string and
> skip the enum object_type conversion. You probably need special
> treatment for packed objects too. See parse_sha1_header() and
> unpack_object_header().
Thank you will look into that!
On 02/18/2015 09:17 PM, Junio C Hamano wrote:
> On Wed, Feb 18, 2015 at 5:58 AM, Duy Nguyen <pclouds@gmail.com> wrote:
>> ... skip the enum object_type conversion. You probably need special
>> treatment for packed objects too.
>
> I do not think you can store object of type "bogus" in a pack data stream
> to begin with, so I wouldn't worry about packed objects.
>
> "cat-file --literally" that does not take "-t" would not be useful, as the
> output "cat-file <type> <object>" does not tell what <type> the thing
> is. Other things like sizes and existence can be inferred once you have
> an interface to do "cat-file <type> <object>", so in that sense -e and -s
> are not essential (this also applies to "cat-file" without --literally).
>
> By definition, "--literally -p" would not be able to do anything fancier than
> just dump the bytes (i.e. what "cat-file <type> <object>" does), as the
> bogus type is not something the code would know the best external
> representation for.
>
Thanks for clearing that out. Will work on this for now.
prev parent reply other threads:[~2015-02-19 10:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-18 9:39 [RFC] git cat-file "literally" option karthik nayak
2015-02-18 12:50 ` karthik nayak
2015-02-18 13:58 ` Duy Nguyen
2015-02-18 15:47 ` Junio C Hamano
2015-02-19 10:10 ` karthik nayak [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54E5B6AC.3030706@gmail.com \
--to=karthik.188@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pclouds@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).