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

Re: [Question] Signature calculation ignoring parts of binary files

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 12, 2018, 22:59 UTC
Message-ID
<xmqq1s9yjp9j.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<000001d44ae6$c2a20ac0$47e62040$@nexbridge.com>
"Randall S. Becker" <rsbecker@nexbridge.com> writes:
>> author is important to our process. My objective is to keep the original file
>> 100% exact as supplied and then ignore any changes to the metadata that I
>> don't care about (like Creator) if the remainder of the file is the same.

That will *not* work. If person A gave you a version of original, which hashes to X after you strip the cruft you do not care about, you would register that original with person A's fingerprint on under the name of X. What happens when person B gives you another version, which is not byte-for-byte identical to the one you got earlier from person A, but does hash to the same X after you strip the cruft? If you are going to store it in Git, and if by SHA-1 you are calling what we perceive as "object name" in Git land, you must store that one with person B's fingerprint on it also under the name of X. Now which version will you get from Git when you ask it to give you the object that hashes to X?

Previous: Randall S. BeckerNext: Randall S. Becker
Message 5 of 10 in “[Question] Signature calculation ignoring parts of binary files”
  1. Randall S. BeckerSep 12, 2018
  2. Johannes SixtSep 12, 2018
  3. Randall S. BeckerSep 12, 2018
  4. Randall S. BeckerSep 12, 2018
  5. Junio C HamanoSep 12, 2018
  6. Randall S. BeckerSep 13, 2018
  7. Junio C HamanoSep 13, 2018
  8. Randall S. BeckerSep 13, 2018
  9. Junio C HamanoSep 13, 2018
  10. Randall S. BeckerSep 13, 2018

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.