Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] Add new setting option to ignore checking submodule #894

Open
leolcao opened this issue Jan 12, 2025 · 0 comments
Open

Comments

@leolcao
Copy link

leolcao commented Jan 12, 2025

Problem status:

On my windows, the command git submodule status is very slow to cause the opening and refresh in sourcegit also slow.

Request:

For the git repo without submodule, I have a chance to add one setting in the .git/sourcegit.settings or from the GUI preference, to let sourcegit don't run the submodule status command.

Diagnostic messages from git by setting GIT_PERFORMANCE_TRACE=<path/to/log file>

21:26:25.849798 trace.c:416             performance: 0.004758900 s: git command: 'C:\Program Files\Git\mingw64\libexec\git-core\git.exe' submodule--helper status --
21:26:25.858403 trace.c:416             performance: 12.852314500 s: git command: git.exe --no-pager -c core.quotepath=off -c credential.helper=manager -c 'core.editor="D:\LeoCao\Programs\dev-tools\SourceGit\SourceGit.exe" --core-editor' submodule status
21:26:25.948978 trace.c:416             performance: 0.001731100 s: git command: 'C:\Program Files\Git\mingw64\libexec\git-core\git.exe' rev-parse --show-prefix
21:26:26.282106 trace.c:416             performance: 0.001772400 s: git command: 'C:\Program Files\Git\mingw64\libexec\git-core\git.exe' rev-parse --show-toplevel
21:26:27.197954 read-cache.c:2400       performance: 0.003644100 s:  read cache .git/index
21:26:27.199977 trace.c:416             performance: 0.007362500 s: git command: 'C:\Program Files\Git\mingw64\libexec\git-core\git.exe' submodule--helper status --
21:26:27.209085 trace.c:416             performance: 9.466387800 s: git command: git.exe --no-pager -c core.quotepath=off -c credential.helper=manager -c 'core.editor="D:\LeoCao\Programs\dev-tools\SourceGit\SourceGit.exe" --core-editor' submodule status
21:26:35.607092 trace.c:416             performance: 0.000562000 s: git command: git.exe rev-parse --show-toplevel

So, it needs more than 12 and 9 seconds to finish 2 commands: git ... submodule status.

I checked the source code of sourcegit, for now, there is no chance to ignore commands sequence from Repository.cs:

public void RefreshAll()
        {
            Task.Run(() =>
            {
                var allowedSignersFile = new Commands.Config(_fullpath).Get("gpg.ssh.allowedSignersFile");
                _hasAllowedSignersFile = !string.IsNullOrEmpty(allowedSignersFile);
            });

            Task.Run(RefreshBranches);
            Task.Run(RefreshTags);
            Task.Run(RefreshCommits);
            Task.Run(RefreshSubmodules);
            Task.Run(RefreshWorktrees);
            Task.Run(RefreshWorkingCopyChanges);
            Task.Run(RefreshStashes);
        }

For other tool, like vscode, it provides one option git.detectSubmodules, so I can set it to false to avoid submodule detecting.

BTW: I know the root cause of slow performance is not from sourcegit, and I didn't find any useful message from other places to improve the git submodule performance on windows, if someone knows, it will be great and thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant