home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] is there a recipe to display the git object store hierarchically?

  • Subject: Re: [OCLUG-Tech] is there a recipe to display the git object store hierarchically?
  • From: Alex Pilon <alp [ at ] alexpilon [ dot ] ca>
  • Date: Fri, 23 Sep 2016 10:56:33 -0400
> On 9/23/2016 4:38 AM, Robert P. J. Day wrote:
> >   i'm aware of things like "git cat-file -p" and so on, but is there
> > some magic incantation to display the git object store
> > graphically/hierarchically?
> >
> > […]
> >

On Fri, Sep 23, 2016 at 09:45:56AM -0400, Michael Soulier wrote:
> git log --graph --decorate --all

Add --oneline to that. However, it still doesn't show the git objects
themselves.

> > but it would be useful to be able to *see* the underlying structure so
> > the class can be truly convinced as to what just happened.

git ls-tree -r --full-tree and git show-ref kinda helps, but you want an
all-inclusive view, right? Sorted how? Branches could complicate this.
Imagine that commits were under commits… the indentation would kill you.
Were you imagining something like this instead?

    [commit] 7427c1e7fb81ac7f069246e5ca8b074dc850ed16 (HEAD,master)
    `- [parent] 0aee3aece23105d0b4bf8fb4e172d74d1f00b8d0
     ` [tree] 753bf03d7f191a400a5d96095fde229040178ce3
       `- 100644 blob a25ed43485aa213ecfce71a8df43f33ab0b8964b    .XCompose
          100644 blob 664369d3b581c88b6900b076cdb702983153e7c1    .agignore
          100644 blob 25f4d5280c90cc26a9d77fb6198c6e909f7275cc    .asoundrc
          […]
    [commit] 0aee3aece23105d0b4bf8fb4e172d74d1f00b8d0 (HEAD~)
    `- […]

Would probably want these to be --topo-sorted.