git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Richards <paul.richards@gmail.com>
To: git@vger.kernel.org
Subject: Re: Enumerating all objects in the Git object store
Date: Fri, 26 Mar 2010 21:11:07 +0000	[thread overview]
Message-ID: <a1138db31003261411o136145eeu14afe75ee3d170f5@mail.gmail.com> (raw)
In-Reply-To: <4BACD86E.4020803@viscovery.net>

On 26 March 2010 15:53, Johannes Sixt <j.sixt@viscovery.net> wrote:
> Am 3/26/2010 16:31, schrieb Paul Richards:
>> Is there a way to enumerate all the objects in the Git
>> object store, and for each one figure out its type (commit, tree, or
>> blob) and obtain a list of the objects it references?  If not, is
>> there a way to do this for a single object at a time?  (I can then
>> simply recurse through the whole structure.)
>
> Use 'git rev-list --objects --all' to find all objects connected to all
> refs (use something else than --all if you want to). Do *not* look at the
> path that the tree and blob objects have attached - it is not authorative
> information.
>
> Use 'git cat-file -t' to find the type.
>
> Use 'git cat-file -p' to pretty-print the content of an object. Parse it
> depending on the type that you find.
>

Thank you, this looks perfect!

I'll check this out (and perhaps the optimizations suggested by Jakub
if necessary).


-- 
Paul Richards

  parent reply	other threads:[~2010-03-26 21:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-26 15:31 Enumerating all objects in the Git object store Paul Richards
2010-03-26 15:53 ` Johannes Sixt
2010-03-26 16:13   ` Jakub Narebski
2010-03-26 17:25   ` Nicolas Pitre
2010-03-26 20:11     ` Johannes Sixt
2010-03-26 20:24       ` Nicolas Pitre
2010-03-26 21:11   ` Paul Richards [this message]
2010-03-27 13:33 ` Michael J Gruber

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=a1138db31003261411o136145eeu14afe75ee3d170f5@mail.gmail.com \
    --to=paul.richards@gmail.com \
    --cc=git@vger.kernel.org \
    /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).