Skip to content

Speed up hasCommits check #470

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hjwp
Copy link

@hjwp hjwp commented Jun 27, 2025

git rev-list --all is very slow for large repositories (order of 5s on a repo with 500k commits).

This alternative version works by checking whether HEAD points at a valid commit.

`git rev-list --all` is very slow for large repositories
(order of 5s on a repo with 500k commits).

This alternative version works by checking whether HEAD points at a valid commit,
by using a git command that returns an error code if not.
This means it has to use the 'silentgitignorefailure'
version of the git invocation functions, and check for an error.
@hjwp hjwp force-pushed the speed-up-hascommit-check branch from c013c58 to ecc0ecd Compare July 4, 2025 11:09
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

Successfully merging this pull request may close these issues.

1 participant