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

Re: Millisecond precision in timestamps?

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 29, 2012, 07:11 UTC
Message-ID
<7va9u0sx26.fsf@alter.siamese.dyndns.org>
In-Reply-To
<E4C993F4-B7A4-4CB6-A9EA-BFE98BE3A381@gmail.com>
Steven Michalske <smichalske@gmail.com> writes:
> Would having arbitrary key value pairs be useful in the git data
> model?

My answer to the question is that it is harmful to the data model, but the benefit of going against the data model _may_ outweigh the downside. It is all relative.

The first of very small number of principles of the git data model is that the object name is derived solely from the contents, hence we can tell two different things apart with object names without looking at object contents.

This is actively broken by adding "junk" fields left and right. Adding arbitrary pieces of data that are optional (and largely ignored by core operations) means you can record objects with essentially the same contents under different object names, so object names no longer help us telling two moral-equivalent objects apart.

But "if two objects have different names, they are not the same" does not have to be the only and the absolute truth in all contexts; the world is not so black and white. Depending on the application and the context, you may want to treat two things that are not the same as equivalents.

For example, at the blob level, two blob objects that store the same text (say, one original and the other typed in double-space) would be different objects and have different object names, but you may want to treat them as "equivalents" (not same but interchangeable), by applying textconv filter to normalize their contents when comparing them. We still keep the "two objects with different names are different" principle, but at the same time, allow users to treat them as equivalent in specific contexts.

Introducing a hack to exclude selective "junk" fields from hashing done for object name computation is not a solution and is out of the question, but that does not necessarily mean that commit objects should never be extended with new types of header fields. When a commit object is made with a "junk" field, it will have a name that is different from the one it would get without the "junk" field, but the benefit of the ability to store extra data _may_ outweigh the downside of having to always compare the contents of two objects with different names to find out that they are different but equivalent.

Previous: Eric S. RaymondNext: Felipe Contreras
Message 37 of 41 in “Millisecond precision in timestamps?”
  1. Eric S. RaymondNov 27, 2012
  2. Shawn PearceNov 27, 2012
  3. Junio C HamanoNov 27, 2012
  4. Eric S. RaymondNov 27, 2012
  5. Shawn PearceNov 27, 2012
  6. Eric S. RaymondNov 28, 2012
  7. David LangNov 28, 2012
  8. Felipe ContrerasNov 28, 2012
  9. Shawn PearceNov 28, 2012
  10. Jeff KingNov 28, 2012
  11. Jason PyeronNov 28, 2012
  12. Felipe ContrerasNov 28, 2012
  13. Eric S. RaymondNov 28, 2012
  14. Jeff KingNov 28, 2012
  15. Felipe ContrerasNov 28, 2012
  16. Eric S. RaymondNov 28, 2012
  17. Jeff KingNov 28, 2012
  18. Eric S. RaymondNov 28, 2012
  19. Junio C HamanoNov 28, 2012
  20. Eric S. RaymondNov 28, 2012
  21. David AguilarNov 28, 2012
  22. Andreas EricssonNov 28, 2012
  23. Robin RosenbergDec 5, 2012
  24. James CloosDec 10, 2012
  25. Thomas BergNov 28, 2012
  26. Felipe ContrerasNov 28, 2012
  27. Thomas BergNov 28, 2012
  28. Junio C HamanoNov 28, 2012
  29. Andreas EricssonNov 28, 2012
  30. Phil HordNov 29, 2012
  31. Jeff KingNov 29, 2012
  32. Eric S. RaymondNov 28, 2012
  33. Felipe ContrerasNov 28, 2012
  34. Junio C HamanoNov 28, 2012
  35. Pyeron, Jason J CTR (US)Nov 27, 2012
  36. Eric S. RaymondNov 29, 2012
  37. Junio C HamanoNov 29, 2012
  38. Felipe ContrerasNov 29, 2012
  39. Eric S. RaymondNov 29, 2012
  40. Junio C HamanoNov 29, 2012
  41. Eric S. RaymondNov 29, 2012

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.