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 27, 2022, 20:03 UTC
Message-ID
<xmqqv8uul2ea.fsf@gitster.g>
In-Reply-To
<a1dcac11-98ac-9fcd-8375-4fd1be9ace78@web.de>
René Scharfe <l.s.r@web.de> writes:
Show 8 quoted lines
>> +	if (prev_options_with_pathspec == options && !options->pathspec.nr)
>> +		BUG("reused struct diff_options, potentially lost pathspec");
>> +	if (options->pathspec.nr)
>> +		prev_options_with_pathspec = options;
>
> This can report a false positive if a diffopt is reused with different
> pathspecs, and one of them is empty (match all).  Which could be countered
> by using a fresh diffopt every time (e.g. pushing it into a loop).

The only use case to reset pathspec of a diffopt during iteration I can think of is the hacky[*] version of "git log --follow" where the pathspec is swapped when a rename of a single path being followed is detected.

    Side note: hacky because the way it swaps a single pathspec upon
    seeing one rename means it does not work in a mergy-branchy
    history where one branch renames and there are still commits
    that need to be explored on the other branch that had the path
    under its original name.
Previous: René ScharfeNext: René Scharfe
Message 15 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.