# Problem with pack

2 messages from 2006-08-25 to 2006-08-25. Participants: Sergio Callegari, Johannes Schindelin.
Thread: https://gitlist.dev/t/5380

## Sergio Callegari, 2006-08-25 08:45

Subject: Problem with pack
Message-ID: <44EEB8AD.5080703@arces.unibo.it>
URL: https://gitlist.dev/e/44EEB8AD.5080703%40arces.unibo.it

```
Hi,

I am encountering a problem after a

git repack -a -d

on an archive.

The packet that has been generated appears to be corrupted:

git verify-pack -v pack-ebcdfbbda07e5a3e4136aa1f499990b35685bab4.idx
fatal: failed to read delta-pack base object 
2849bd2bd8a76bbca37df2a4c8e8b990811d01a7

and apparently I might have lost all the history of my project.

I have a few questions:

1) I am working on both a pc and a notebook, syncing the two everytime I 
move from one to the other.
On the PC I have git 1.4.2, on the notebook git 1.4.0. I am using 
"unison" as a syncing tool.
Might the data loss have something to do with...
- the version of git I am using or the mixing of two versions?
- the syncing? I have noticed that after a sync, git is not immediately 
in a happy state... for instance if I run

git diff

git lists diff commands for every file, even if those have not changed. 
However after a

git status

everything seems fine again.

2) git unpack-objects seems to be able to extract some objects from the 
pack, but at a certain point it dies.
- does it die on the first error or does it try to extract everything 
that is possible to extract after the error?
- if it's the first, is there a way to trigger the second behaviour to 
try to save as much as possible from the pack?

Thanks,

Sergio Callegari

```

## Johannes Schindelin, 2006-08-25 09:12

Subject: Re: Problem with pack
Message-ID: <Pine.LNX.4.63.0608251104410.28360@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0608251104410.28360%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <44EEB8AD.5080703@arces.unibo.it>

```
Hi,

On Fri, 25 Aug 2006, Sergio Callegari wrote:

> git verify-pack -v pack-ebcdfbbda07e5a3e4136aa1f499990b35685bab4.idx
> fatal: failed to read delta-pack base object 2849bd2bd8a76bbca37df2a4c8e8b990811d01a7

Eeeh! Not good.

> 1) I am working on both a pc and a notebook, syncing the two everytime I move
> from one to the other.

So, you still have one "good" version? Please make a backup immediately. 
(If only to reproduce the problem.)

> On the PC I have git 1.4.2, on the notebook git 1.4.0. I am using "unison" as
> a syncing tool.
> Might the data loss have something to do with...
> - the version of git I am using or the mixing of two versions?

We tried very hard to maintain backward compatibility. So, it should be 
fine.

> - the syncing? I have noticed that after a sync, git is not immediately in a
> happy state...

That is okay. The "index" (remember, git has a staging area called 
"index") stores ctimes and mtimes, and these are not synced.

> 2) git unpack-objects seems to be able to extract some objects from the pack,
> but at a certain point it dies.
> - does it die on the first error or does it try to extract everything that is
> possible to extract after the error?

Since unpack-objects does not use the index, it cannot extract anything 
after the first error. We _could_ enhance unpack-objects to be nice and 
optionally take a pack-index to try to reconstruct as many objects as 
possible.

BTW I'd recommend not syncing with unison, but with the git transports: If 
your PC and Laptop are connected, you could do something like

	git pull laptop:my_project/.git

(Of course, you have to adjust it for your setup.) This would sync your 
repository on the PC with the one on the laptop.

Hth,
Dscho

```
