# List all SHA1 hashes in repo

8 messages from 2008-03-23 to 2008-03-23. Participants: Alexander Gladysh, Peter Harris, Johannes Schindelin, Pieter de Bie, Junio C Hamano.
Thread: https://gitlist.dev/t/12817

## Alexander Gladysh, 2008-03-23 13:17

Subject: List all SHA1 hashes in repo
Message-ID: <c6c947f60803230617if9606baxea21fa99dc3df37c@mail.gmail.com>
URL: https://gitlist.dev/e/c6c947f60803230617if9606baxea21fa99dc3df37c%40mail.gmail.com

```
Hi, list!

To help testing little Git-related tool I'm writing, I need a lot of
pregenerated SHA1 hashes. Git repo seems to be a perfect source of
such. Is there an easy way to extract a list of all (well, most of)
SHA1 hashes in the repo?

The git rev-list --all gives nice list, but, as I understand, that is
only commit objects, and there are much more of SHA1 hidden inside.

Thanks in advance,
Alexander.

```

## Peter Harris, 2008-03-23 13:40

Subject: Re: List all SHA1 hashes in repo
Message-ID: <eaa105840803230640j11ffa096x511a81b1c0b8f40e@mail.gmail.com>
URL: https://gitlist.dev/e/eaa105840803230640j11ffa096x511a81b1c0b8f40e%40mail.gmail.com
In-Reply-To: <c6c947f60803230617if9606baxea21fa99dc3df37c@mail.gmail.com>

```
On Sun, Mar 23, 2008 at 9:17 AM, Alexander Gladysh <agladysh@gmail.com> wrote:
>  To help testing little Git-related tool I'm writing, I need a lot of
>  pregenerated SHA1 hashes. Git repo seems to be a perfect source of
>  such. Is there an easy way to extract a list of all (well, most of)
>  SHA1 hashes in the repo?

After a "git gc" to roll everything into a single pack, you could do a
"git verify-pack -v" to list all the SHA1s in the pack.

Peter Harris

```

## Johannes Schindelin, 2008-03-23 13:59

Subject: Re: List all SHA1 hashes in repo
Message-ID: <alpine.LSU.1.00.0803231459100.4353@racer.site>
URL: https://gitlist.dev/e/alpine.LSU.1.00.0803231459100.4353%40racer.site
In-Reply-To: <c6c947f60803230617if9606baxea21fa99dc3df37c@mail.gmail.com>

```
Hi,

On Sun, 23 Mar 2008, Alexander Gladysh wrote:

> To help testing little Git-related tool I'm writing, I need a lot of
> pregenerated SHA1 hashes. Git repo seems to be a perfect source of
> such. Is there an easy way to extract a list of all (well, most of)
> SHA1 hashes in the repo?
> 
> The git rev-list --all gives nice list, but, as I understand, that is
> only commit objects, and there are much more of SHA1 hidden inside.

Just add --objects.

Ciao,
Dscho

```

## Pieter de Bie, 2008-03-23 14:21

Subject: Re: List all SHA1 hashes in repo
Message-ID: <7B06FEDE-799E-431B-8F35-C1B6AE40BE8D@ai.rug.nl>
URL: https://gitlist.dev/e/7B06FEDE-799E-431B-8F35-C1B6AE40BE8D%40ai.rug.nl
In-Reply-To: <alpine.LSU.1.00.0803231459100.4353@racer.site>

```

On Mar 23, 2008, at 2:59 PM, Johannes Schindelin wrote:
>> The git rev-list --all gives nice list, but, as I understand, that is
>> only commit objects, and there are much more of SHA1 hidden inside.
>
> Just add --objects.

I thought --all --objects only shows reachable objects?

- Pieter

(Dscho, sorry for the double post)

```

## Johannes Schindelin, 2008-03-23 14:33

Subject: Re: List all SHA1 hashes in repo
Message-ID: <alpine.LSU.1.00.0803231532150.4353@racer.site>
URL: https://gitlist.dev/e/alpine.LSU.1.00.0803231532150.4353%40racer.site
In-Reply-To: <540004BB-49C4-456B-ABA3-62659D85C15E@ai.rug.nl>

```
Hi,

On Sun, 23 Mar 2008, Pieter de Bie wrote:

> On Mar 23, 2008, at 2:59 PM, Johannes Schindelin wrote:
> > > The git rev-list --all gives nice list, but, as I understand, that 
> > > is only commit objects, and there are much more of SHA1 hidden 
> > > inside.
> >
> > Just add --objects.
> 
> I thought --all --objects only shows reachable objects?

Ah yes.  But usually the objects in packs are reachable...

So you're right, it does not really show _all_ objects.  But it shows many 
objects, and is pretty easy (which I think was the original poster's real 
question).

Ciao,
Dscho

P.S.: I got two mails from you, one without the Cc: list, and one with 
it...  Strange.

```

## Alexander Gladysh, 2008-03-23 15:44

Subject: Re: List all SHA1 hashes in repo
Message-ID: <c6c947f60803230844s6489422xba49a074d226702a@mail.gmail.com>
URL: https://gitlist.dev/e/c6c947f60803230844s6489422xba49a074d226702a%40mail.gmail.com
In-Reply-To: <alpine.LSU.1.00.0803231532150.4353@racer.site>

```
> > > > The git rev-list --all gives nice list, but, as I understand, that
>  > > > is only commit objects, and there are much more of SHA1 hidden
>  > > > inside.
>  > >
>  > > Just add --objects.
>
> > I thought --all --objects only shows reachable objects?
>
>  Ah yes.  But usually the objects in packs are reachable...
>
>  So you're right, it does not really show _all_ objects.  But it shows many
>  objects, and is pretty easy (which I think was the original poster's real
>  question).

Yes, this is a perfect solution. Thank you!

Alexander.

P.S. Sorry for double-posting, Dscho, I forgot Reply to All too. :-)

```

## Junio C Hamano, 2008-03-23 18:23

Subject: Re: List all SHA1 hashes in repo
Message-ID: <7v8x097111.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v8x097111.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <alpine.LSU.1.00.0803231532150.4353@racer.site>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> Hi,
>
> On Sun, 23 Mar 2008, Pieter de Bie wrote:
>
>> On Mar 23, 2008, at 2:59 PM, Johannes Schindelin wrote:
>> > > The git rev-list --all gives nice list, but, as I understand, that 
>> > > is only commit objects, and there are much more of SHA1 hidden 
>> > > inside.
>> >
>> > Just add --objects.
>> 
>> I thought --all --objects only shows reachable objects?
>
> Ah yes.  But usually the objects in packs are reachable...
>
> So you're right, it does not really show _all_ objects.

"rev-list --objects --all"?

```

## Johannes Schindelin, 2008-03-23 18:48

Subject: Re: List all SHA1 hashes in repo
Message-ID: <alpine.LSU.1.00.0803231947530.4353@racer.site>
URL: https://gitlist.dev/e/alpine.LSU.1.00.0803231947530.4353%40racer.site
In-Reply-To: <7v8x097111.fsf@gitster.siamese.dyndns.org>

```
Hi,

On Sun, 23 Mar 2008, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > On Sun, 23 Mar 2008, Pieter de Bie wrote:
> >
> >> On Mar 23, 2008, at 2:59 PM, Johannes Schindelin wrote:
> >> > > The git rev-list --all gives nice list, but, as I understand, 
> >> > > that is only commit objects, and there are much more of SHA1 
> >> > > hidden inside.
> >> >
> >> > Just add --objects.
> >> 
> >> I thought --all --objects only shows reachable objects?
> >
> > Ah yes.  But usually the objects in packs are reachable...
> >
> > So you're right, it does not really show _all_ objects.
> 
> "rev-list --objects --all"?

I think Pieter's point was that there can be unreachable objects, an this 
command line does not show them.

Ciao,
Dscho

```
