-
Notifications
You must be signed in to change notification settings - Fork 252
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
Fix fetching git history + fallback to unshallow repo #74
Conversation
For most situation it should be enough to find merge base. Previous value was too slow and overhead of doing fetch was significantly higher than saving of transfer.
The latest release of the paths-filter action 2.9.1 caused a failure of all CI update jobs. This release contained a single PR dorny/paths-filter#74 The error message in all of our CI setup jobs was: Run dorny/paths-filter@v2 with: filters: visual: - 'tokens/**' - 'vue-components/**' behavioral: - 'vue-components/**' token: *** list-files: none initial-fetch-depth: 100 Changes will be detected against the branch master Searching for merge-base master...QuantityInput /usr/bin/git rev-list --count --all 640 /usr/bin/git merge-base master QuantityInput fatal: Not a valid object name master /usr/bin/git fetch --depth=1280 origin master:master QuantityInput From wmde/wikit * [new branch] master -> master * branch QuantityInput -> FETCH_HEAD /usr/bin/git rev-list --count --all 640 No more commits were fetched Last attempt will be to fetch full history /usr/bin/git fetch --unshallow fatal: --unshallow on a complete repository does not make sense Error: The process '/usr/bin/git' failed with exit code 128
This PR caused our CI to consistently fail. Going back to 2.9.0 resolved the issue. The error message in the logs:
|
Thanks for reporting the issue. I rolled back |
I think I know what happened. I will fix it soon |
The latest release of the paths-filter action 2.9.1 caused a failure of all CI update jobs. This release contained a single PR dorny/paths-filter#74 The error message in all of our CI setup jobs was: Run dorny/paths-filter@v2 with: filters: visual: - 'tokens/**' - 'vue-components/**' behavioral: - 'vue-components/**' token: *** list-files: none initial-fetch-depth: 100 Changes will be detected against the branch master Searching for merge-base master...QuantityInput /usr/bin/git rev-list --count --all 640 /usr/bin/git merge-base master QuantityInput fatal: Not a valid object name master /usr/bin/git fetch --depth=1280 origin master:master QuantityInput From wmde/wikit * [new branch] master -> master * branch QuantityInput -> FETCH_HEAD /usr/bin/git rev-list --count --all 640 No more commits were fetched Last attempt will be to fetch full history /usr/bin/git fetch --unshallow fatal: --unshallow on a complete repository does not make sense Error: The process '/usr/bin/git' failed with exit code 128
@micgro42 |
Thank you for the quick fix 🙏 |
Fetching git history did not worked in all cases.
As described in #71 - either deepening the history or counting the commits didn't worked as expected.
This PR uses combination of
--depth
on initial fetch and later--deepen
is used to extend historyCommits are now counted on all branches
git rev-list --count --all
.It also increases default value of initial-fetch-depth to 100.
For most cases it should only do a single fetch.
As a last fallback try - whole history is fetched by turning shallow repo into full clone using
git fetch --unshallow
closes #71