git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: checking sha1's of files

From
Caleb Cushing <xenoterracide@gmail.com>
Date
Feb 8, 2009, 10:53 UTC
Message-ID
<81bfc67a0902080253x5082201co7da3319b8237f5a0@mail.gmail.com>
In-Reply-To
<7veiy9z1v8.fsf@gitster.siamese.dyndns.org>
On Sun, Feb 8, 2009 at 4:58 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 6 quoted lines
> Caleb Cushing <xenoterracide@gmail.com> writes:
>
>> I need to check the hashes of specific files in the repo in an
>> automated fashion, in another tool.
>
> What "hash" are you talking about?  sha1?  md5?  crc?

just at at a vague glance currently sha1, sha256, and rmd160 if I'm reading the manifest file correct.

Show 10 quoted lines
> I *think* you are trying to say that gentoo has a tool to compute some
> sort of hash for regular files in their source tree by:
>
>        "gentoo's portage tree has manifests for each file"
>
> but without knowing what kind of hash they use, I cannot tell you if you
> can reuse some part of git to compute their hash without using their tools
> (it also is unclear why you are not using their tool to compute their hash
> and instead are expecting git to know about the specific hash function
> used by them).

I think you misunderstand. I'm not trying to use git to compute their hash, I'm trying to replace their hash with git. Once I've figured out how to validate the git hash with 'emerge' (said tool) I will be removing their hash's.

Show 6 quoted lines
> For exammple,
>
>        "sha1sum Makefile"
>
> would give you the SHA-1 checksum of the contents of the Makefile.  Is
> that what gentoo's tools expect?

I'm honestly not sure how all it's calculated, only that the gentoo tool will have to be modified, only part of the Manifest file that will be left is the check that is used to validate files not in the tree (e.g. our distfiles, package tarballs)

> If that is the case, that is different
> from the blob object name git will give to the contents of that Makefile,
> so you cannot reuse much of git.
>
git has it's own internal integrity check right? on the blob's.

I don't intend to make git fit gentoo's system, I intend to make gentoo (or regen2 rather) use git's integrity system. but integrity checks are only a small part of the larger tool. I have the feeling that I will have to write code on both ends to make it work. Gentoo uses rsync and no git repository, so to validate integrity they use files with recorded hashes in them. as I understand it git hashes the files (blobs) internally, so now that we've imported the rsync tree and started using the 'git' protocol we're really doing the same thing twice, and recording it more than that.

has this explanation helped?
-- 
Caleb Cushing

http://xenoterracide.blogspot.com
Previous: Junio C HamanoNext: Jeff King
Message 3 of 7 in “checking sha1's of files”
  1. Caleb CushingFeb 8, 2009
  2. Junio C HamanoFeb 8, 2009
  3. Caleb CushingFeb 8, 2009
  4. Jeff KingFeb 8, 2009
  5. Caleb CushingFeb 8, 2009
  6. Jeff KingFeb 8, 2009
  7. Caleb CushingFeb 8, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.