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

Re: [RFC] [PATCH 0/5] Implement 'prior' commit object links (and other commit links ideas)

From
Sam Vilain <sam@vilain.net>
Date
Apr 25, 2006, 23:18 UTC
Message-ID
<444EAE63.1070006@vilain.net>
In-Reply-To
<7v7j5e2jv7.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
Show 14 quoted lines
>Here is a related but not necessarily competing idle thought.
>
>How about an ability to "attach" arbitrary objects to commit
>objects?  The commit object would look like:
>
>    tree 0aaa3fecff73ab428999cb9156f8abc075516abe
>    parent 5a6a8c0e012137a3f0059be40ec7b2f4aa614355
>    parent e1cbc46d12a0524fd5e710cbfaf3f178fc3da504
>    related a0e7d36193b96f552073558acf5fcc1f10528917 key
>    related 0032d548db56eac9ea09b4ba05843365f6325b85 cherrypick
>    author Junio C Hamano <junkio@cox.net> 1145943079 -0700
>    committer Junio C Hamano <junkio@cox.net> 1145943079 -0700
>  
>

I agree with the criticisms of the patchset, and I think this is probably a more comprehensive and less ambiguous solution. I originally thought that the use cases were close enough together that they could be called the same thing, but I see now that they are not.

IMHO one important goal is to stop "parent" from meaning anything other than:

1. for a regular commit, the base for this change. The change consists
of the differences between the two trees.
2. for a "merge", the merge parents for this change. The change consists
of all differences between the index merges (allowing duplicate blobs at
each location) and the final merged tree.

If you were to, for a moving merge head, just record the previous merge as a "parent", then it would make it difficult to look at the commit history to figure out which parent links represent the last merge, and which represent the merge bases.

This suggestion fixes that problem nicely, while being nice and flexible for solving the other problems too.

Show 20 quoted lines
>    Merge branch 'pb/config' into next
>
>    * pb/config:
>      Deprecate usage of git-var -l for getting config vars list
>      git-repo-config --list support
>
>The format of "related" attribute is, keyword "related", SP, 40-byte
>hexadecimal object name, SP, and arbitrary sequence of bytes
>except LF and NUL.  Let's call this arbitrary sequence of bytes
>"the nature of relation".
>
>The semantics I would attach to these "related" links are as
>follows:
>
> * To the "core" level git, they do not mean anything other than
>   "you must to have these objects, and objects reachable from
>   them, if you are going to have this commit and claim your
>   repository is without missing objects".
>  
>

This is essentially correct, however you have already described a use case where you want the behaviour to be to lose the previous commit chain:

Show 8 quoted lines
>The reason I do not include the previous head when I reconstruct
>"pu" is because I explicitly *want* to drop history -- not
>having to carry forward a failed experiment is what is desired
>there.  Otherwise I would manage "pu" just like I currently do
>"next" and "master".  So this is not a justification to add
>something new.
>  
>

In this case, I think that there are types of relations that are more along the lines of "don't bother following this link by default, but warn/fail if it is unavailable depending on the user preferences".

git-fsck could then have options to prune (or archive) certain types of optional relations. This way people can still record complete history if they like. And people who want to mark portions of history as bad (such as, violating copyright law) have a clear way to state that intent.

Show 9 quoted lines
>That means "git-rev-list --objects" needs to list these objects
>(and if they are tags, commits, and trees, then what are
>reachable from them), and "git-fsck" needs to consider these
>related objects and objects reachable from them are reachable
>from this commit.  NOTHING ELSE NEEDS TO BE DONE by the core
>(obviously, cat-file needs to show them, and commit-tree needs to
>record them, but that goes without saying).
>  
>
Ok, I'll investigate that.
Show 5 quoted lines
>Then porcelains can agree on what different kinds of nature of
>relation mean and do sensible things.  The earlier "omit the
>cherry-picked ones" example I gave can examine "cherrypick".
>  
>
Sounds good. Let things evolve.
Sam.
Previous: Jakub NarebskiNext: Linus Torvalds
Message 57 of 63 in “Implement 'prior' commit object links”
  1. Sam VilainApr 25, 2006
  2. 1/5 add 'prior' link in commit structureSam Vilain, Apr 25, 2006
  3. Junio C HamanoApr 25, 2006
  4. 2/5 git-merge-base: follow 'prior' links to find merge basesSam Vilain, Apr 25, 2006
  5. Junio C HamanoApr 25, 2006
  6. 4/5 git-commit-tree: add support for priorSam Vilain, Apr 25, 2006
  7. 5/5 git-commit: add --prior to set prior linkSam Vilain, Apr 25, 2006
  8. 3/5 commit.c: parse 'prior' linkSam Vilain, Apr 25, 2006
  9. Sam VilainApr 25, 2006
  10. Junio C HamanoApr 25, 2006
  11. Sam VilainApr 25, 2006
  12. Jakub NarebskiApr 26, 2006
  13. Jakub NarebskiApr 26, 2006
  14. [OT] Re: [RFC] [PATCH 0/5] Implement 'prior' commit object linksJunio C Hamano, Apr 26, 2006
  15. Jakub NarebskiApr 26, 2006
  16. Junio C HamanoApr 26, 2006
  17. Jakub NarebskiApr 26, 2006
  18. Junio C HamanoApr 26, 2006
  19. Jakub NarebskiApr 26, 2006
  20. Junio C HamanoApr 26, 2006
  21. Jakub NarebskiApr 26, 2006
  22. Sam VilainApr 26, 2006
  23. Jakub NarebskiApr 25, 2006
  24. Junio C HamanoApr 25, 2006
  25. Jakub NarebskiApr 25, 2006
  26. seanApr 25, 2006
  27. Linus TorvaldsApr 25, 2006
  28. Linus TorvaldsApr 25, 2006
  29. seanApr 25, 2006
  30. Linus TorvaldsApr 25, 2006
  31. Andreas EricssonApr 26, 2006
  32. Jakub NarebskiApr 26, 2006
  33. Jakub NarebskiApr 25, 2006
  34. Linus TorvaldsApr 25, 2006
  35. Jakub NarebskiApr 25, 2006
  36. Linus TorvaldsApr 25, 2006
  37. Linus TorvaldsApr 25, 2006
  38. Jakub NarebskiApr 25, 2006
  39. seanApr 25, 2006
  40. Linus TorvaldsApr 25, 2006
  41. seanApr 25, 2006
  42. Linus TorvaldsApr 25, 2006
  43. Jakub NarebskiApr 25, 2006
  44. Linus TorvaldsApr 25, 2006
  45. Jakub NarebskiApr 25, 2006
  46. Jason RiedyApr 25, 2006
  47. seanApr 25, 2006
  48. Linus TorvaldsApr 25, 2006
  49. Junio C HamanoApr 25, 2006
  50. Linus TorvaldsApr 25, 2006
  51. Junio C HamanoApr 25, 2006
  52. Linus TorvaldsApr 25, 2006
  53. Jakub NarebskiApr 26, 2006
  54. Junio C HamanoApr 25, 2006
  55. Linus TorvaldsApr 25, 2006
  56. Jakub NarebskiApr 25, 2006
  57. Sam VilainApr 25, 2006
  58. Linus TorvaldsApr 25, 2006
  59. seanApr 25, 2006
  60. Jakub NarebskiApr 25, 2006
  61. Junio C HamanoApr 25, 2006
  62. Jakub NarebskiApr 25, 2006
  63. Jakub NarebskiApr 29, 2006

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.