ScanFile hangs commit dialog
What steps will reproduce the problem?
- Create an empty repository.
- Commit some random file (so we have at least one commit).
- Copy this file to the working dir.
- Open the commit dialog and commit it (all good).
- Open the commit dialog again and amend the last commit (showing the util.js on the list).
A short video reproducing the bug is available here: https://www.youtube.com/watch?v=PC1X_2so-xw
PS: You don't need to follow exactly that steps, just create a scenario where util.js will be commited and it will be parsed for extracting function names for auto complete.
What is the expected output?
Don't hang the dialog...
What do you see instead?
It hangs TortoiseGitProc.exe when parsing the .js file for autocompletion.
What version of TortoiseGit and Git are you using? On what operating system?
TortoiseGit 22.214.171.124 on Windows 10 build 19044.
Please provide any additional information below.
I already tested it on the master branch, same issue.
I did some digging and the issue is here:
CCommitDlg::GetAutocompletionList there is a mechanism for timing out long running completion lists, but it won't work since the tight loop happens inside the
CCommitDlg::ScanFile in the try/catch block.
Some weird regex issue happens there and it won't finish parsing.
For now, as workaround I have set
AutocompleteParseMaxSize to 0.