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

Re: [PATCH] t4202 (log): add failing test for log with subtree

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Apr 22, 2013, 15:46 UTC
Message-ID
<CALkWK0kgQqhG_ojuxZ85mTF8rhLf=wv5dGamU8z+cFxpN7QWYQ@mail.gmail.com>
In-Reply-To
<87wqruk2pj.fsf@linux-k42r.v.cablecom.net>
Thomas Rast wrote:
Show 9 quoted lines
> So (I think?) in the above you claim that $USER interprets
>
>   git log -- README.md
>
> as
>
>   Show me the history of README.md.
>
> But there's no such thing as the history of a file!

I made no such claims. I might not know as much as you or the others on the list about git, but I can certainly grok how git stores history.

There needs to be some amount of mutual respect for a healthy conversation: if you start assuming midway that I don't understand what history is, we have a problem.

> So please don't write tests that go contrary to that definition, because
> they're *wrong*.  The current implementation precisely matches the
> current definition of pathspec filtering.

Who said anything about changing any definitions? Where are you getting all this from?

How does "git log HEAD~3 -- README" work? It sets up a revision walk to start from HEAD~3 going all the way down to the root commit. In each of these commits, it looks for the entry "README" in the corresponding tree. It then runs diff-tree with the previous commit's tree to see if the object (blob) corresponding to the "README" entry is different: if so, it selects the commit and displays it.

Now, what am I saying? I'm saying that this approach assumes that all trees are read into /. A pathspec "subproject/README" is _only_ present in the subtree-merge commit^{tree} and nowhere else. The current log algorithm might try to look for the entry "subproject/README" (your pathspec) in all the commit^{tree}s of the commits leading up to M^2. That is _not_ the problem, as I have already illustrated that --follow follows over merges. The problem is looking for the pathspec "subproject/README" in the first place: those commit^{trees}s have the entry stored as "README".

Am I making any sense, or are you going to accuse me of not understanding trees now?

Previous: Thomas RastNext: Ramkumar Ramachandra
Message 13 of 34 in “t4202 (log): add failing test for log with subtree”
  1. t4202 (log): add failing test for log with subtreeRamkumar Ramachandra, Apr 22, 2013
  2. Matthieu MoyApr 22, 2013
  3. Thomas RastApr 22, 2013
  4. Ramkumar RamachandraApr 22, 2013
  5. Ramkumar RamachandraApr 22, 2013
  6. Ramkumar RamachandraApr 22, 2013
  7. Matthieu MoyApr 22, 2013
  8. Thomas RastApr 22, 2013
  9. Thomas RastApr 22, 2013
  10. Ramkumar RamachandraApr 22, 2013
  11. Ramkumar RamachandraApr 22, 2013
  12. Thomas RastApr 22, 2013
  13. Ramkumar RamachandraApr 22, 2013
  14. Ramkumar RamachandraApr 22, 2013
  15. Ramkumar RamachandraApr 22, 2013
  16. Ramkumar RamachandraApr 22, 2013
  17. Thomas RastApr 22, 2013
  18. Ramkumar RamachandraApr 22, 2013
  19. Philip OakleyApr 22, 2013
  20. Ramkumar RamachandraApr 22, 2013
  21. Ramkumar RamachandraApr 22, 2013
  22. Matthieu MoyApr 22, 2013
  23. Junio C HamanoApr 22, 2013
  24. Ramkumar RamachandraApr 22, 2013
  25. Ramkumar RamachandraApr 22, 2013
  26. Junio C HamanoApr 22, 2013
  27. Ramkumar RamachandraApr 23, 2013
  28. Junio C HamanoApr 23, 2013
  29. Ramkumar RamachandraApr 23, 2013
  30. Junio C HamanoApr 22, 2013
  31. Ramkumar RamachandraApr 22, 2013
  32. Matthieu MoyApr 22, 2013
  33. Junio C HamanoApr 22, 2013
  34. Ramkumar RamachandraApr 22, 2013

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.