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
Junio C Hamano <junkio@cox.net>
Date
Apr 25, 2006, 19:00 UTC
Message-ID
<7vr73lwkdt.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0604251125010.3701@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 27 quoted lines
> On Tue, 25 Apr 2006, sean wrote:
>
>> On Tue, 25 Apr 2006 11:08:31 -0700 (PDT)
>> Linus Torvalds <torvalds@osdl.org> wrote:
>> 
>> > Which is exactly what I told you to do. Just don't make it a git header. 
>> 
>> Well I just don't see how making it a header, or plopping it at the
>> end of a commit message makes an iota of difference to git, while it 
>> can help porcelain.
>
> It can't help porcelain.
>
> If we have undefined or bad semantics for it, the only thing it can do is 
> _hurt_ porcelain, because it will cause confusion down the line.
>
> Semantics for data objects are _the_ most important part of a SCM. Pretty 
> much any project, in fact. 
>
> And bad or weakly defined semantics will invariably cause problems later.
>
>> But that's exactly the point, it's no different than extending git to be
>> able to store more than one comment.
>
> So why argue for it?
>
> Just use the existing comment field.

Actually, it does help Porcelain to be able to mark unrelated crud as 'note'. Sane people (including git barebone Porcelainish) would just ignore it. Unless --pretty=raw is used the 'note' headers will not be shown. It would unclutter things for us.

If different Porcelains use "the existing comment field" by defining certain mark-up to embed their own data, it has the same "weak semantics causing confusion down the line" issue, _and_ the crud will be shown to the end user by "git log".

So I am starting to be actually in favor of the 'note' header.

Earlier somebody wondered if that has impact on merge semantics. I think we do _not_ care. The core level does not track how things changed (the operation to make preimage to postimage), but tracks what the results of changes are (the content).

Some "misguided" set of Porcelains may come up with a convention to record renames and token-replaces in the 'note' header to say:

	tree 0000000000000000000000000000000000000000
        parent 0000000000000000000000000000000000000000
	author A U Thor <author@example.com> 000000000 +0000
	committer C O Mitter <comitter@example.com> 000000000 +0000
	note rename hello.c world.c
        note token-replace s/cache/index/
        Replaced old nomenclature 'cache' to 'index'.  Oh, while
        at it, I renamed hello.c to world.c.

But unlike systems that records the transformation from preimage to postimage, we record the postimage (on "tree" header) and preimage (by the way of "parent" header). We (as the core and Porcelain that do not use "note") do not even need to look at what 'note' says. The Porcelains that _do_ look at the note may try to take advantage of it, and if they make better result that would be a good thing. I suspect such 'note rename' provided by the end user is not trustworthy at times, so a Porcelain that relies on that may make silent mismerge. You may claim that is the reason why you do not want to pull from a tree managed with such a Porcelain.

But at the end of the day what matters is the content, and people.

You will not be using such a Porcelain yourself, but when you fetch the above commit, which records its tree and its parents, git barebone Porcelainish merge will just do what it has always done, without even looking at 'note'. It's not like use of 'note' on the other end is forcing you to take a note on them.

Refusing to merge from a tree that is managed with a Porcelain that uses the information in 'note rename' for its own operation (maybe because we believe such Porcelain tends to make silent mismerges more often) does not make much more sense than refusing to merge from a tree whose developer uses vi (because it tends to lose "missing LF at the end of file"). The content matters, so you would check the merge result; and 'note' thing is opt-in, which we opt out.

Also you ultimately trust people -- "I will pull from his tree, because I know he is careful and has good taste". Now the tool they use _may_ be part of their taste, but any tool can be misused (remember you stayed away from pulling things that have Octopus?)

I am less (a lot less) sure about the 'related' header now, which will be the topic of a separate message.

Previous: Jakub NarebskiNext: Linus Torvalds
Message 54 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.