Since upgrading to version 4.2.10 or 4.2.11 of SourceTree, it takes a very long time (sometimes up to half a minute) to open certain repositories which is very very annoying.
This issue was also reported here: https://community.atlassian.com/t5/Sourcetree-questions/Sourcetree-4-2-10-on-macOS-is-slow-at-opening-some-repositories/qaq-p/2877856
The analysis over there seems to be correct I think:
> Looking a the debug task monitor the problem seems to be related to the 'list repo config files' step that runs a script called 'list-repo-config-files.sh' (this appears to be new in version 4.2.10).
> If the repository has lots of directories then this script is quite slow.
> I believe it might be missing a '-maxdepth 0' in the find command like this:
find "$1" -type d -maxdepth 0 | while read -r dir; do
> which would make it only search for a ./git/config or /config file at the root of the passed in directory (rather than recursively in in all directories).
If I check one of my own projects that has this problem, and search for how many directories it has, it has a LOT of them:
$ find . -type d | wc -l 352390
If I compare it with a project that opens pretty quickly, I can see that the amount of directories is a lot lower there:
$ find . -type d | wc -l 46920
Hopefully you can optimise that script a bit, so it takes a lot less time to execute on big projects.
Thanks!