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, 12:57 UTC
Message-ID
<81bfc67a0902080457k65988e5bw8a33ea8aff2c0c2f@mail.gmail.com>
In-Reply-To
<20090208122731.GA24442@coredump.intra.peff.net>
Show 5 quoted lines
> If you want to know whether a file matches HEAD, just do:
>
>  git diff --quiet HEAD -- $LIST_OF_FILES
>
> which will return '0' for no changes or '1' if there are changes.
*headdesks* and somehow I think this is exactly what I need.
Show 5 quoted lines
> Which really has nothing to do with hashes at all (though git will use
> them internally to avoid actually running a textual diff at all).  I was
> assuming that you didn't necessarily _have_ the git repository at
> verification time. So the hash becomes an easy way of saying "this is
> what the file _should_ look like".

I love git because it's so powerful, just like the rest of *nix. No matter how long I use it something always makes me feel like a n00b.

the problem is that I only half understand what git is doing, just enough to attempt a communication of what I want to do. It doesn't help that I'm not the expert on the other side of this problem either.

thanks for the help guys, even if I do come off like a moron.
-- 
Caleb Cushing

http://xenoterracide.blogspot.com
Previous: Jeff King
Message 7 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.