Git shallow clone for better performance#2403
Open
pukkaone wants to merge 1 commit intospring-cloud:mainfrom
Open
Git shallow clone for better performance#2403pukkaone wants to merge 1 commit intospring-cloud:mainfrom
pukkaone wants to merge 1 commit intospring-cloud:mainfrom
Conversation
spencergibb
requested changes
Apr 9, 2024
Member
spencergibb
left a comment
There was a problem hiding this comment.
Unfortunately we can't make a change like this that changes the default existing behavior for everyone in a minor.
Member
|
Maybe if you make it opt in with a configuration flag |
68f2926 to
d0c8281
Compare
Author
|
I added a configuration flag where the default is the existing behavior. |
| public CloneCommand getCloneCommandByCloneRepository() { | ||
| CloneCommand command = Git.cloneRepository().setCloneSubmodules(cloneSubmodules); | ||
| if (cloneShallow) { | ||
| command.setDepth(1); |
There was a problem hiding this comment.
why not allowing to specify a depth instead?
| } | ||
|
|
||
| public JGitFactory(boolean cloneSubmodules) { | ||
| public JGitFactory(boolean cloneShallow, boolean cloneSubmodules) { |
There was a problem hiding this comment.
this will break compatibility with anybody calling the one parameter constructor. Also, I would put cloneShallow first. It should be the second parameter.
By default, the server clones the entire commit history from a remote repository. Downloading a huge commit history might be slow, so add a configuration property to truncate the commit history to a few commits. Fixes spring-cloud#1544
d0c8281 to
a5786c0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Do not download the entire commit history from the remote. Execute the equivalent of
git clone --depth 1Fixes #1544