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.