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

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

From
Randall S. Becker <rsbecker@nexbridge.com>
Date
Sep 13, 2018, 15:38 UTC
Message-ID
<003a01d44b77$d0b289a0$72179ce0$@nexbridge.com>
In-Reply-To
<xmqqefdxign2.fsf@gitster-ct.c.googlers.com>
On September 13, 2018 11:03 AM, Junio C Hamano wrote:
Show 17 quoted lines
> "Randall S. Becker" <rsbecker@nexbridge.com> writes:
> 
> > The scenario is slightly different.
> > 1. Person A gives me a new binary file-1 with fingerprint A1. This
> > goes into git unchanged.
> > 2. Person B gives me binary file-2 with fingerprint B2. This does not
> > go into git yet.
> > 3. We attempt a git diff between the committed file-1 and uncommitted
> > file-2 using a textconv implementation that strips what we don't need to
> compare.
> > 4. If file-1 and file-2 have no difference when textconv is used,
> > file-2 is not added and not committed. It is discarded with impunity,
> > never to be seen again, although we might whine a lot at the user for
> > attempting to put
> > file-2 in - but that's not git's issue.
> 
> You are forgetting that Git is a distributed version control system,
aren't you?
> Person A and B can introduce their "moral equivalent but bytewise
different"
> copies to their repository under the same object name, and you can pull
from
> them--what happens?
> 
> It is fundamental that one object name given to Git identifies one
specific
> byte sequence contained in an object uniquely.  Once you broke that, you
no
> longer have Git.

At that point I have a morally questionable situation, agreed. However, both are permitted to exist in the underlying tree without conflict in git - which I do consider a legitimately possible situation that will not break the application at all - although there is a semantic conflict in the application (not in git) that requires human decision to resolve. The fact that both objects can exist in git with different fingerprints is a good thing because it provides immutable evidence and ownership of someone bypassing the intent of the application.

So, rather than using textconv, I shall implement this rule in the application rather than trying to configure git to do it. If two conflicting objects enter the commit history, the application will have the responsibility to resolve the semantic/legal conflict.

Thanks, Randall

Previous: Junio C HamanoNext: Junio C Hamano
Message 8 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.