Skip to content

Use bounded git rev-list for version detection#4163

Open
pavelToman wants to merge 1 commit into
easybuilders:developfrom
pavelToman:patch-18
Open

Use bounded git rev-list for version detection#4163
pavelToman wants to merge 1 commit into
easybuilders:developfrom
pavelToman:patch-18

Conversation

@pavelToman

Copy link
Copy Markdown
Contributor

This PR avoids an unnecessary full Git history traversal during EasyBuild version detection.

Currently the code uses git rev-list HEAD and then only keeps the first returned commit hash. On large repositories or filesystems with slow metadata access, this can make even simple commands like eb --version noticeably slow, because git rev-list HEAD walks the full reachable commit history.

Since EasyBuild only needs the current HEAD commit hash here, this PR changes the call to the equivalent of:

git rev-list -n 1 HEAD

This preserves the existing GitPython-based implementation and the resulting version string, but avoids traversing more history than needed.

In my local testing on an HPC filesystem, this reduced warm eb --version startup time from many seconds to about 0.5 s, while keeping the same reported EasyBuild version and Git revision hashes.
This is the matching change for the same version-detection pattern in easyblocks.

*this PR was created with help of ChatGPT5.5

Framework PR:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants