# Repository authenticity question

4 messages from 2009-06-13 to 2009-06-17. Participants: Kārlis Repsons, Michael J Gruber.
Thread: https://gitlist.dev/t/19803

## Kārlis Repsons, 2009-06-13 15:26

Subject: Repository authenticity question
Message-ID: <200906131527.03450.Karlis.Repsons@gmail.com>
URL: https://gitlist.dev/e/200906131527.03450.Karlis.Repsons%40gmail.com

```
Hi,
It would be good to know what did Linus meant, when he said "and they will 
fail" about people, who would try changing some git projects' history (that 
is, the content, that is added already)? If I loose my repository completely, 
can I still know, that those contributions there are the same after I pull 
and how? What contents can be deleted, while still retaining consistency?

Regards,
Kārlis

```

## Michael J Gruber, 2009-06-13 15:45

Subject: Re: Repository authenticity question
Message-ID: <4A33C980.40003@drmicha.warpmail.net>
URL: https://gitlist.dev/e/4A33C980.40003%40drmicha.warpmail.net
In-Reply-To: <200906131527.03450.Karlis.Repsons@gmail.com>

```
Kārlis Repsons venit, vidit, dixit 13.06.2009 17:26:
> Hi,
> It would be good to know what did Linus meant, when he said "and they will 
> fail" about people, who would try changing some git projects' history (that 
> is, the content, that is added already)? If I loose my repository completely, 
> can I still know, that those contributions there are the same after I pull 
> and how? What contents can be deleted, while still retaining consistency?
> 
> Regards,
> Kārlis

The sha1 ("object name") of a commit depends not only on its contents,
but on all its predecessors. So if you know one commit's sha1 to be
"original" you know for all its ancestors.

Michael

```

## Kārlis Repsons, 2009-06-17 07:57

Subject: Re: Repository authenticity question
Message-ID: <200906170757.59476.Karlis.Repsons@gmail.com>
URL: https://gitlist.dev/e/200906170757.59476.Karlis.Repsons%40gmail.com
In-Reply-To: <4A33C980.40003@drmicha.warpmail.net>

```
On Saturday 13 June 2009 15:45:04 you wrote:
> Kārlis Repsons venit, vidit, dixit 13.06.2009 17:26:
> > Hi,
> > It would be good to know what did Linus meant, when he said "and they
> > will fail" about people, who would try changing some git projects'
> > history (that is, the content, that is added already)? If I loose my
> > repository completely, can I still know, that those contributions there
> > are the same after I pull and how? What contents can be deleted, while
> > still retaining consistency?
> >
> > Regards,
> > Kārlis
>
> The sha1 ("object name") of a commit depends not only on its contents,
> but on all its predecessors. So if you know one commit's sha1 to be
> "original" you know for all its ancestors.
>
> Michael

So, if I clone someone else's git archive, sha1 of a known commit must be 
compared and what else? How to check if all of archive's sha1-s are identical 
to its contents and every content is included?

```

## Michael J Gruber, 2009-06-17 08:07

Subject: Re: Repository authenticity question
Message-ID: <4A38A45C.6080708@drmicha.warpmail.net>
URL: https://gitlist.dev/e/4A38A45C.6080708%40drmicha.warpmail.net
In-Reply-To: <200906170757.59476.Karlis.Repsons@gmail.com>

```
Kārlis Repsons venit, vidit, dixit 17.06.2009 09:57:
> On Saturday 13 June 2009 15:45:04 you wrote:
>> Kārlis Repsons venit, vidit, dixit 13.06.2009 17:26:
>>> Hi,
>>> It would be good to know what did Linus meant, when he said "and they
>>> will fail" about people, who would try changing some git projects'
>>> history (that is, the content, that is added already)? If I loose my
>>> repository completely, can I still know, that those contributions there
>>> are the same after I pull and how? What contents can be deleted, while
>>> still retaining consistency?
>>>
>>> Regards,
>>> Kārlis
>>
>> The sha1 ("object name") of a commit depends not only on its contents,
>> but on all its predecessors. So if you know one commit's sha1 to be
>> "original" you know for all its ancestors.
>>
>> Michael
> 
> So, if I clone someone else's git archive, sha1 of a known commit must be 
> compared and what else? How to check if all of archive's sha1-s are identical 
> to its contents and every content is included?

As I said: if the sha1 of one commit agrees with what what you have or
know then, automatically, all ancestry is "original": commits as well as
contents.

You can check the repo itself using "git fsck", this makes sure that all
referenced content is included.

Michael

```
