Skip to content

Add shallow submodule init support.#63

Closed
monaka wants to merge 1 commit intojenkinsci:masterfrom
monami-ya:pr-shallow-update-submodule
Closed

Add shallow submodule init support.#63
monaka wants to merge 1 commit intojenkinsci:masterfrom
monami-ya:pr-shallow-update-submodule

Conversation

@monaka
Copy link

@monaka monaka commented Jan 6, 2014

As you know, recent git (since 1.8.x) supports shallow submodule cloning.
This patch is just to add API method.
I'll send pull requests to git-plugin after this patch was approved.

@cloudbees-pull-request-builder

plugins » git-client-plugin #219 SUCCESS
This pull request looks good

@ndeloof
Copy link
Contributor

ndeloof commented Jan 6, 2014

Would probably be more flexible to introduce an UpdateCommand (like Clone or Fetch one) so a shallow option can be created as a git-plugin behavior extension

@monaka
Copy link
Author

monaka commented Jan 6, 2014

Probably not UpdateCommand but SubmoduleCommand.Update.shallow() or something.
It will be too heavy fix (at least to me). I'm afraid whether it can keep the backward compatibility.
I think my patch is a realistic approach.

@ndeloof
Copy link
Contributor

ndeloof commented Jan 6, 2014

realistic but not flexible enough for future plugin evolution. We move shallow concept and comparable exotic uses in "advanced behavior" to avoid over-complexity on git plugin. See previous commits in history for a sample of refactoring fetch into a Command

@jenkinsadmin
Copy link
Member

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@monaka
Copy link
Author

monaka commented Jan 7, 2014

I see. I'll re-push here after I create a ticket.

Recent versions of git supports the shallow update (--depth={n}) option.
This patch is to add this new feature by adding methods
submoduleUpdate(boolean recursive, boolean shallow, String reference).
@cloudbees-pull-request-builder

plugins » git-client-plugin #220 SUCCESS
This pull request looks good

@monaka
Copy link
Author

monaka commented Jan 8, 2014

I have a question.
I read the document @jenkinsadmin points. And I see I'm encouraged to write unit tests.
But it seems there is no test around submoduleUpdate() in the git repository.
Must I write all tests from scratch???

@ndeloof
Copy link
Contributor

ndeloof commented Jan 8, 2014

There's indeed lots of missing tests, if you can contribute some you're welcome.

@monaka
Copy link
Author

monaka commented Jan 8, 2014

Oh... Basically I agree it's better way to write unit tests.
But could you forgive me for now?
This pull request is enough simple. ;-)

@ndeloof
Copy link
Contributor

ndeloof commented Jan 8, 2014

sure, anyway I won't apply this pull request as-is, as commented earlier, preferred way to extend API with additional parameters it to switch to Command pattern

@monaka
Copy link
Author

monaka commented Jan 8, 2014

I see. Then, I close this pull request and I use it in my house.
I wonder someone fix it.

@monaka monaka closed this Jan 8, 2014
@cdbennett
Copy link

👍 I would like to see this implemented. Maybe it's not perfectly ideal design, but it would be great to have in projects with many submodules having a large history

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.

5 participants