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

Re: [PATCH] 2.36 gitk/diff-tree --stdin regression fix

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 26, 2022, 15:26 UTC
Message-ID
<xmqqo80nsw5h.fsf@gitster.g>
In-Reply-To
<6ac7e164-c4ba-0ffc-a8a4-4cede1d4e7ae@gmail.com>

I wonder if we would have caught a regression like the one if we used FREE_AND_NULL more sparingly. For example, if we prematurely called clear_pathspec(), the second iteration, because there is free-and-null of pathspec->items and resetting pathspec->nr to 0, would behave very normally as if there is no pathspec. If we just freed things, without NULLing them out or resetting .nr to 0, the second iteration would try to access garbage and hopefully we will catch a crash before such a code would have escaped the lab.

In any case, based on what I heard here, it appears that mimicking "git log" does may probably be a better way to deal with this regression? As you said, all the other things diff_free() calls are unwanted while "diff-tree --stdin" is still working, just like "log"?

Thanks.
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 16 in “gitk regression in version 2.36.0”
  1. Matthias AßhauerApr 23, 2022
  2. Junio C HamanoApr 23, 2022
  3. Junio C HamanoApr 23, 2022
  4. René ScharfeApr 23, 2022
  5. Junio C HamanoApr 23, 2022
  6. 2.36 gitk/diff-tree --stdin regression fixJunio C Hamano, Apr 25, 2022
  7. t4013: diff-tree --stdin with pathspecJunio C Hamano, Apr 25, 2022
  8. Phillip WoodApr 26, 2022
  9. Phillip WoodApr 26, 2022
  10. Junio C HamanoApr 26, 2022
  11. Junio C HamanoApr 26, 2022
  12. 2.36 gitk/diff-tree --stdin regression fixJunio C Hamano, Apr 26, 2022
  13. René ScharfeApr 27, 2022
  14. René ScharfeApr 27, 2022
  15. Junio C HamanoApr 27, 2022
  16. René ScharfeApr 23, 2022

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.