monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] Re: sha1sum doesn't match revision number


From: Bruce Stephens
Subject: [Monotone-devel] Re: sha1sum doesn't match revision number
Date: Thu, 01 Sep 2005 21:58:48 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

"Todd A. Jacobs" <address@hidden> writes:

> A while back, I'd asked about how to identify the revision which
> matched a file stored outside the repository. IIRC, one of the
> suggestions was to use sha1sum to get the hash and find the matching
> revision, but that doesn't appear to work. The file and the revision
> number always have different hashes, so I'm guessing that the
> internal hash in monotone isn't hashing *just* the file.

You misunderstand, I think.  The revision id is a hash of the
revision.  The manifest contains hashes of the constituent files.  For
example:

        % cat MT/revision
        8f5dd295d896c8937622b9ebcae3bb61c0a2e0e5
(This is of net.venge.monotone.)
        % monotone cat manifest | grep vocab.cc
        cebf734fb6a83a66665786e2c1486d4934137066  vocab.cc
        % sha1sum vocab.cc
        cebf734fb6a83a66665786e2c1486d4934137066

(If I'd changed vocab.cc, then the hash reported by sha1sum would be
different, of course.  But I haven't.)

As discussed previously, you can't go from that hash to a unique
revision, because it may appear in many (and almost certainly does),
if the contents of the file stays the same in some revisions.  

It may be useful to go from a hash to a list of all revisions which
contain it (together with the filenames, since the same contents may
be in files with different names, of course), but I don't think
there's anything to do that at the moment.

[...]





reply via email to

[Prev in Thread] Current Thread [Next in Thread]