-
Notifications
You must be signed in to change notification settings - Fork 889
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
Adds Depth to FetchOptions allowing for shallow cloning #2070
base: master
Are you sure you want to change the base?
Adds Depth to FetchOptions allowing for shallow cloning #2070
Conversation
Hello, what's next for this pull request ? |
Someone needs to review and approve it I guess. Not sure if this is something @bording could do? |
/// Default value is 0 (full) fetch. | ||
/// </para> | ||
/// </summary> | ||
public int Depth { get; set; } = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be unnecessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume you are referring to the = 0
part only.
// a new instance of GitFetchOptions we only populate the Depth field. | ||
var fetchOptions = new GitFetchOptions | ||
{ | ||
Depth = options.FetchOptions.Depth, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FetchOptions
could be null at this point - possible NRE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't look like the case to me. The FetchOptions
property is defined as:
public FetchOptions FetchOptions { get; } = new();
@@ -794,7 +801,7 @@ public static string Clone(string sourceUrl, string workdirPath) | |||
} | |||
|
|||
using (var checkoutOptionsWrapper = new GitCheckoutOptsWrapper(options)) | |||
using (var fetchOptionsWrapper = new GitFetchOptionsWrapper()) | |||
using (var fetchOptionsWrapper = new GitFetchOptionsWrapper(fetchOptions)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need another test for this extra options : what if it is null and being passed to the ctor?
Also, how about using using var ... (we might want to remove the brackets)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If FetchOptions.Depth is not set (or is set to 0) behaviour should be as before (i.e. should do a non-shallow clone), correct? So that is what should be tested?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All previously existing tests would essentially already be testing that though...
@amirvenus Do you have write-access and can get this merged? |
Do the unresolved comments block this PR? If the original creator is not around to address them, would it be acceptable for someone else to take over and create a new PR? |
so what are the news about this PR? |
If practical or required, I'm available to help. Just LMK what I can do. We are streaming git repo state across a distributed CD/CI system and shallow clones dramatically reduce our bandwidth needs. |
Is there any updates on this PR? |
Just to repeat @YanisThePie 's question from earlier. Are any of the comments on the PR actually blocking the merge? I think there may be some arguments that this could go through as it is. If a maintainer could provide feedback and clarify whether adjustments are needed that would be great. If indeed necessary I would be happy to open up a new PR if @andersklepaker is no longer dealing with this. |
Thanks for the comments @karlschriek
Yeah that would be great, and if so happens I'll finish up the work needed for this PR. I did not prioritize investing time here since this repo seems mostly inactive, sadly :( |
Are there any further updates? It would be greatly appreciated if this PR could be merged soon assuming there are no open comments or code changes required. |
Please, can someone do something about this forgotten PR?... @amirvenus could you merge this please? |
thanks @amirvenus for your approval! Are there still steps to go through before the PR is merge? |
@karlschriek I think this PR can now be completed? 🤞 |
@bording can you merge this PR? |
This PR adds
Depth
toFetchOptions
allowing for shallow cloning.Since I'm new to this repo and it's complexity it's possible i've missed some key information to why this have not been implemented, and if so I'm sorry for not reading up on it prior to submitting this PR.
Resolves #229