-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Optimize git library installation #607
base: development
Are you sure you want to change the base?
Conversation
This paves the way for local scopes, which won't depend on the current version set in the repository.
- Less global state - Slightly fewer exceptions
Also fix submodules being checked out from wrong branch Closes HaxeFoundation#593
@kLabz Could you check if this makes sense git-wise? |
I don't think I'll have time today, so will look at this tomorrow. It likely breaks some workflow I use from time to time (using git dependency, and doing git commands in |
Somehow this PR causes #591 to be triggered on Windows with pretty much every |
It should be possible to get the full commit id from the short one once you have added a git remote:
It might be worth always fetching the commit id so as not to lose your optimisation when a branch or tag is specified instead of a commit id. This can be done this way:
Hope this helps. |
This doesn't work if the commit hasn't been fetched:
Not sure I understand, which optimisation are you talking about that would be lost? |
Any progress on this? |
The main issue that's blocking this is #591, there is no point in optimising git commands if it will break them 😅. Maybe it can work in development with the interp target and hxb, but that would mean that it doesn't work with haxe 4.3.x. |
Closes #493. For most git installs, a (faster) shallow clone can now be performed with
--depth=1
, which avoids cloning the entire history and instead only clones one commit's worth of history, including for the submodules. The only exception where a shallow clone cannot be performed is when setting a library to a specific commit with a short commit id, for example:This is due to how commit ids are resolved.
The data which was used to install the library is now stored in a
.gitdata
file, to avoid issues of overwriting externally created commits. With this.gitdata
file, it is now possible to be smarter when reinstalling the same library, which also fixes #512.Now when updating a git library, it will now only update if it was installed with the default branch or a specific branch. If it was installed with a specific commit or tag, it remains at that commit/tag, since there is no clear commit to update to.
Finally, this also fixes #593, since the submodules have to be cloned after switching to the correct branch in order to clone them with
--depth=1
as well.Mercurial works differently, so I've just left it as is.