Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

andersklepaker
Copy link

This PR adds Depth to FetchOptions 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

@fmargerit
Copy link

Hello, what's next for this pull request ?

@andersklepaker
Copy link
Author

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;

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

// a new instance of GitFetchOptions we only populate the Depth field.
var fetchOptions = new GitFetchOptions
{
Depth = options.FetchOptions.Depth,

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

Copy link

@karlschriek karlschriek Sep 4, 2024

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))

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)

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?

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...

@andersklepaker
Copy link
Author

@amirvenus Do you have write-access and can get this merged?

@goaaats
Copy link

goaaats commented May 26, 2024

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?

@YanisThePie
Copy link

so what are the news about this PR?

@dcworldwide
Copy link

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.

@sureshkk
Copy link

Is there any updates on this PR?

@karlschriek
Copy link

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.

@andersklepaker
Copy link
Author

Thanks for the comments @karlschriek

If a maintainer could provide feedback and clarify whether adjustments are needed that would be great.

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 :(

@IEDAWHI
Copy link

IEDAWHI commented Sep 12, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shallow clone support
9 participants