On what do I compute the sha1 hash? [was Re: Q: Use rebase to get around corrupted knit file?]

Kevin Cole dc.loco at gmail.com
Wed Dec 10 20:19:21 GMT 2008

Kevin Cole <dc.loco <at> gmail.com> writes:

> Hi,
> After searching the web, and a brief chat in IRC, I'm still a bit lost, 
> I think I'm closing in on an answer and looking for clarification here.
> A while back, on a dapper machine, I had bzr 0.8.2.  It appeared to be doing 
> things reasonably okay, until I tried to move the whole repository to a newer 
> system.  Then, it told me a knit file was corrupt. Specifically:
> | KnitCorrupt: Knit <bzrlib.knit._KnitAccess object at 0x8ebde0c>
> | corrupt: While reading {...20070302012644-b26b4baa985aa020} got 
> | error(Error -3 while decompressing: invalid distance too far back)
> Eventually I got more details via:
> cd .bzr
> find . -name "*.knit" -exec gunzip -t {} \;
> which revealed:
> | gunzip:
> | ./.bzr/repository/knits/75/types.html-20070302012458-1d7f486c93a59c92.knit:
> | invalid compressed data--crc error
> | gunzip:
> | ./.bzr/repository/knits/75/types.html-20070302012458-1d7f486c93a59c92.knit:
> | invalid compressed data--length error
> types.html-*.knit also show up in /knits/24/ and /knits/90/.
> Further investigation shows this file (types.html) to be part of the Python 
> Library Reference, deleted from the repository ago (revision 3, according to 
> the bzr log).  The repository is now up to revision 90.

Stubbornly not wanting to lose this repository, I've attempted to rebuild the 
single missing file from scratch.  

At what point in the process do I compute the sha1 hash that goes on the end of 
the version line?  Can I do that with "sha1sum filename"?
(So far, I have the source data, the "version" header with address timestamp 
and hex from the original broken knit filename, and the number of lines of 
data.  I also have the line prefixes, and the "end" footer.  And it looks like 
the very last thing in the .kndx (before the colon) is the size of the 
compressed file.  So I can add that in when I'm done.)


More information about the bazaar mailing list