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

Re: Question about get_cached_commit_buffer()

From
Jeff King <peff@peff.net>
Date
Feb 21, 2018, 18:52 UTC
Message-ID
<20180221185204.GA8476@sigill.intra.peff.net>
In-Reply-To
<20180221184811.GD4333@sigill.intra.peff.net>
On Wed, Feb 21, 2018 at 01:48:11PM -0500, Jeff King wrote:
Show 11 quoted lines
> > What confuses me about this behavior is that the OID is still shown on the
> > repeat (and in the case of `git log --oneline` will not actually have a line
> > break between two short-OIDs). I don't believe this behavior is something to
> > preserve.
> 
> I think that repeating the oid is intentional; the point is to dump how
> the traversal code is hitting the endpoints, even if we do so multiple
> times.
> 
> The --oneline behavior just looks like a bug. I think --format is broken
> with --show-all, too (it does not show anything!).

I poked at one of the examples a little more closely. I actually think these are not repeats, but simply UNINTERESTING parents that we never needed to look at in our traversal (because we hit a point where everything was UNINTERESTING).

So we are relying not on finish_commit() to have freed the buffer, but on the traversal code to have never parsed those commits in the first place. Which is doubly subtle.

I think the rest of my email stands, though: we should just show the full headers for those commits.

-Peff
Previous: Jeff KingNext: Derrick Stolee
Message 5 of 17 in “Question about get_cached_commit_buffer()”
  1. Derrick StoleeFeb 20, 2018
  2. Jeff KingFeb 20, 2018
  3. Derrick StoleeFeb 21, 2018
  4. Jeff KingFeb 21, 2018
  5. Jeff KingFeb 21, 2018
  6. commit: drop uses of get_cached_commit_buffer()Derrick Stolee, Feb 21, 2018
  7. Derrick StoleeFeb 21, 2018
  8. Jeff KingFeb 21, 2018
  9. Jeff KingFeb 21, 2018
  10. Stefan BellerFeb 21, 2018
  11. Jeff KingFeb 21, 2018
  12. Derrick StoleeFeb 22, 2018
  13. Junio C HamanoFeb 21, 2018
  14. Jeff KingFeb 21, 2018
  15. Junio C HamanoFeb 21, 2018
  16. revision: drop --show-all optionJeff King, Feb 21, 2018
  17. Linus TorvaldsFeb 21, 2018

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.