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

Re: Regression in v2.26.0-rc0 and Magit

From
Kyle Meyer <kyle@kyleam.com>
Date
Mar 14, 2020, 05:57 UTC
Message-ID
<87h7yr8omj.fsf@kyleam.com>
In-Reply-To
<xmqqy2s4axa2.fsf@gitster.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
> That does not still explain why Magit (which is sufficiently mature)
> is expecting "cd .git && ls-files .." to show the entire working
> tree, though.

The specific ls-files call that seems to trigger the segfault on Magit's end is equivalent to

  cd .git && git ls-files --error-unmatch -- $PWD/COMMIT_EDITMSG

The code is running ls-files to ask whether the file is tracked, which of course isn't a sensible thing to do outside of the working tree. I'll propose a change on Magit's end to avoid doing so.

[ A few more specifics that might be of interest to Magit users ]

This happens in magit-auto-revert-mode. When visiting a file in .git/ (e.g., COMMIT_EDITMSG when committing), magit-auto-revert-mode decides whether to turn on auto-revert-mode in the same way it does for other files, magit-turn-on-auto-revert-mode-if-desired. That function doesn't distinguish whether the file is in .git or the working tree, leading to the odd "is tracked file?" query above.

Previous: Junio C HamanoNext: SZEDER Gábor
Message 7 of 9 in “Regression in v2.26.0-rc0 and Magit”
  1. Jean-Noël AVILAMar 12, 2020
  2. Jonathan NiederMar 12, 2020
  3. Junio C HamanoMar 13, 2020
  4. Junio C HamanoMar 13, 2020
  5. Jonathan NiederMar 13, 2020
  6. Junio C HamanoMar 13, 2020
  7. Kyle MeyerMar 14, 2020
  8. SZEDER GáborMar 15, 2020
  9. Junio C HamanoMar 15, 2020

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.