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

Re: [RFC] origin link for cherry-pick and revert, and more about porcelain-level metadata

From
Paolo Bonzini <bonzini@gnu.org>
Date
Sep 10, 2008, 09:35 UTC
Message-ID
<48C794D6.20001@gnu.org>
In-Reply-To
<20080909230525.GC10360@machine.or.cz>
> Why do you actually *follow* the origin link at all anyway? Without its
> parents, the associated tree etc., the object is essentially useless for
> you

Stephen posed the origin links as weak, but it is not necessarily true that you don't have the parents and the associated tree. For example, if you download a repository that includes a "master" branch and a few stable branches, you *will* have the objects cherry-picked into stable branches, because they are commits in the master branch.

Junio explained that the way achieves the same effect in git is by forking the topic branch off the "oldest" branch where the patch will possibly be of interest. Then he can merge it in that branch and all the newest ones. That's great, but not all people are as forward-looking (he did say that sometimes he needs to cherrypick).

Another problem is that in some projects actually there are two "maint" branches (e.g. currently GCC 4.2 and GCC 4.3), and most developers do not care about what goes in the older "maint" branch; they develop for trunk and for the newer "maint" branch, and then one person comes and cherry-picks into the older "maint" branch. This has two problems:

1) Having to fork topic branches off the older branch would force extra
testing on the developers.
2) Besides this, topic branches are not cloned, so if I am the
integrator on the older "maint" branch, I need to dig manually in the
commits to find bugfixes.  True, I could use Bugzilla, but what if I
want to use git instead?  There is "git cherry -v ... | grep -w ^+.*PR",
except that it has too many false negatives (fixes that have already
been backported, but do show up in the list).
> And why are the notes created by git cherry-pick -x insufficient for that?

For example, these notes (or the ones created by "git revert") are *wrong* because they talk about commits instead of changesets (deltas between two commits).

Why is only one commit present? Because these messages are meant for users, not for programs. That's easy to show: users think of commits as deltas anyway, even though git stores them as snapshots---"git show HEAD" shows a delta, not a snapshot.

And what does this mean for programs? That they must resort to commit-message scraping to distinguish the two cases. (*)

   (*) A GUI blame program, for example, would need to distinguish
   whether code added by a commit is taken from commit 4329bd8, or is
   reverting commit 4329bd8.  (In the first case, the author of that
   code is whoever was responsible for that code in 4329bd8; in the
   second case, it is whoever was responsible for that code in
   4329bd8^).  If recording changesets, you see 4329bd8^..4329bd8 in
   the first case, and 4329bd8..4329bd8^ in the second, so it is trivial
   to follow the chain.

And scraping is bad. Imagine people that are writing commit messages in their native language. What if they patch git to translate the magic notes created by "git cherry-pick -x" or "git revert" (maybe a future version of git will do that automatically)? Should they translate also every program that scrapes the messages?

Whenever there is a piece of data that could be useful to programs (no
matter if plumbing or porcelain), I consider free form notes to be bad.
 Because data is data, and metadata is metadata.

If there was a generic way to put porcelain-level metadata in commit messages (e.g. Signed-Off-By and Acknowledged-By can be already considered metadata), I would not be so much in favor of "origin" links being part of the commit object's format. Now if you think about it, commit references within this kind of metadata would have mostly the properties that Stephen explained in his first message:

1) they would be rewritten by git-filter-branch
2) these references, albeit weak by default, could optionally be
followed when fetching (either with command-line or configuration options)
3) they would not be pruned by git-gc
4) possibly, git rev-list --topo-order would sort commits by taking into
account metadata references too.
So the implementation effort would be roughly the same.

But, can you think of any other such metadata? Personally I can't, so while I understand the opposition to a new commit header field that would be there from here to eternity (or until the LHC starts), I do think it is the simplest thing that can possibly work.

Paolo
Previous: Stephen R. van den BergNext: Petr Baudis
Message 108 of 137 in “[RFC] origin link for cherry-pick and revert”
  1. Stephen R. van den BergSep 9, 2008
  2. Paolo BonziniSep 9, 2008
  3. Stephen R. van den BergSep 9, 2008
  4. Stephen R. van den BergSep 9, 2008
  5. Jakub NarebskiSep 9, 2008
  6. Steven GrimmSep 9, 2008
  7. Stephen R. van den BergSep 9, 2008
  8. Jeff KingSep 9, 2008
  9. Stephen R. van den BergSep 9, 2008
  10. Junio C HamanoSep 9, 2008
  11. Shawn O. PearceSep 9, 2008
  12. Jeff KingSep 9, 2008
  13. Jakub NarebskiSep 9, 2008
  14. Jakub NarebskiSep 9, 2008
  15. Paolo BonziniSep 10, 2008
  16. Stephen R. van den BergSep 10, 2008
  17. Junio C HamanoSep 10, 2008
  18. Stephen R. van den BergSep 10, 2008
  19. Junio C HamanoSep 9, 2008
  20. Jeff KingSep 9, 2008
  21. Stephen R. van den BergSep 9, 2008
  22. Jakub NarebskiSep 9, 2008
  23. Stephen R. van den BergSep 9, 2008
  24. Linus TorvaldsSep 9, 2008
  25. Stephen R. van den BergSep 9, 2008
  26. Linus TorvaldsSep 10, 2008
  27. Stephen R. van den BergSep 10, 2008
  28. Linus TorvaldsSep 10, 2008
  29. Stephen R. van den BergSep 10, 2008
  30. Linus TorvaldsSep 11, 2008
  31. Stephen R. van den BergSep 11, 2008
  32. Jakub NarebskiSep 11, 2008
  33. Stephen R. van den BergSep 11, 2008
  34. Theodore TsoSep 11, 2008
  35. Stephen R. van den BergSep 11, 2008
  36. Theodore TsoSep 11, 2008
  37. Stephen R. van den BergSep 11, 2008
  38. Nicolas PitreSep 11, 2008
  39. Stephen R. van den BergSep 11, 2008
  40. Nicolas PitreSep 11, 2008
  41. Stephen R. van den BergSep 11, 2008
  42. Jakub NarebskiSep 11, 2008
  43. Stephen R. van den BergSep 11, 2008
  44. A Large Angry SCMSep 12, 2008
  45. Stephen R. van den BergSep 12, 2008
  46. Theodore TsoSep 11, 2008
  47. Jeff KingSep 11, 2008
  48. Stephen R. van den BergSep 11, 2008
  49. Jeff KingSep 11, 2008
  50. Stephen R. van den BergSep 11, 2008
  51. Linus TorvaldsSep 11, 2008
  52. Jeff KingSep 11, 2008
  53. Stephen R. van den BergSep 11, 2008
  54. Nicolas PitreSep 11, 2008
  55. Stephen R. van den BergSep 11, 2008
  56. Nicolas PitreSep 11, 2008
  57. Stephen R. van den BergSep 11, 2008
  58. Nicolas PitreSep 11, 2008
  59. Junio C HamanoSep 11, 2008
  60. Stephen R. van den BergSep 11, 2008
  61. Stephen R. van den BergSep 11, 2008
  62. A Large Angry SCMSep 11, 2008
  63. Stephen R. van den BergSep 11, 2008
  64. A Large Angry SCMSep 12, 2008
  65. Stephen R. van den BergSep 12, 2008
  66. Linus TorvaldsSep 11, 2008
  67. Paolo BonziniSep 11, 2008
  68. Linus TorvaldsSep 11, 2008
  69. Stephen R. van den BergSep 11, 2008
  70. Jakub NarebskiSep 11, 2008
  71. Stephen R. van den BergSep 11, 2008
  72. Nicolas PitreSep 11, 2008
  73. Stephen R. van den BergSep 11, 2008
  74. Nicolas PitreSep 11, 2008
  75. Stephen R. van den BergSep 12, 2008
  76. Theodore TsoSep 11, 2008
  77. Stephen R. van den BergSep 12, 2008
  78. Paolo BonziniSep 10, 2008
  79. Linus TorvaldsSep 10, 2008
  80. Paolo BonziniSep 10, 2008
  81. Linus TorvaldsSep 10, 2008
  82. Linus TorvaldsSep 10, 2008
  83. Paolo BonziniSep 10, 2008
  84. Stephen R. van den BergSep 10, 2008
  85. Jakub NarebskiSep 10, 2008
  86. Sam VilainSep 11, 2008
  87. Linus TorvaldsSep 11, 2008
  88. Sam VilainSep 12, 2008
  89. Stephen R. van den BergSep 12, 2008
  90. Rogan DawesSep 12, 2008
  91. Stephen R. van den BergSep 12, 2008
  92. Theodore TsoSep 12, 2008
  93. Paolo BonziniSep 12, 2008
  94. Jakub NarebskiSep 12, 2008
  95. Paolo BonziniSep 12, 2008
  96. Theodore TsoSep 12, 2008
  97. Stephen R. van den BergSep 12, 2008
  98. Jeff KingSep 12, 2008
  99. Stephen R. van den BergSep 12, 2008
  100. Theodore TsoSep 12, 2008
  101. Stephen R. van den BergSep 12, 2008
  102. Sam VilainSep 15, 2008
  103. Jakub NarebskiSep 9, 2008
  104. Petr BaudisSep 9, 2008
  105. Stephen R. van den BergSep 9, 2008
  106. Petr BaudisSep 9, 2008
  107. Stephen R. van den BergSep 9, 2008
  108. Paolo BonziniSep 10, 2008
  109. Petr BaudisSep 10, 2008
  110. Stephen R. van den BergSep 10, 2008
  111. Petr BaudisSep 10, 2008
  112. Stephen R. van den BergSep 10, 2008
  113. Dmitry PotapovSep 10, 2008
  114. Stephen R. van den BergSep 10, 2008
  115. Paolo BonziniSep 10, 2008
  116. Theodore TsoSep 10, 2008
  117. Stephen R. van den BergSep 10, 2008
  118. Jeff KingSep 10, 2008
  119. Stephen R. van den BergSep 10, 2008
  120. Jeff KingSep 10, 2008
  121. Stephen R. van den BergSep 10, 2008
  122. Jeff KingSep 10, 2008
  123. Stephen R. van den BergSep 10, 2008
  124. Paolo BonziniSep 11, 2008
  125. Stephen R. van den BergSep 11, 2008
  126. Paolo BonziniSep 11, 2008
  127. A Large Angry SCMSep 11, 2008
  128. Nicolas PitreSep 11, 2008
  129. Theodore TsoSep 10, 2008
  130. Petr BaudisSep 10, 2008
  131. Paolo BonziniSep 10, 2008
  132. Stephen R. van den BergSep 10, 2008
  133. Paolo BonziniSep 10, 2008
  134. Recording "partial merges" (was: Re: [RFC] origin link for cherry-pick and revert)Peter Krefting, Sep 23, 2008
  135. Miklos VajnaSep 10, 2008
  136. Nicolas PitreSep 10, 2008
  137. Miklos VajnaSep 10, 2008

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.