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

Shallow clones #13

Open
Vampire opened this issue Nov 25, 2021 · 9 comments
Open

Shallow clones #13

Vampire opened this issue Nov 25, 2021 · 9 comments

Comments

@Vampire
Copy link
Contributor

Vampire commented Nov 25, 2021

I think for the use-cases of this plugin doing shallow clones would be appropriate, so that you don't need to clone the full history for a repository just to use the latest state for building.
Optimally it would be an option, so that users can decide whether they want shallow clones or not.

@melix
Copy link
Owner

melix commented Nov 25, 2021

I thought about this but the problem is that it makes the logic of updating much more complicated. What if you change the branch configuration and had shallow=true? What if you had shallow=false, change it to true with a different branch? etc. Not saying that this isn't doable, but it is much more complex to implement.

@Vampire
Copy link
Contributor Author

Vampire commented Nov 25, 2021

Keep this open for when you are bored and need something to do. :-D
It's not super important, but it would save disk space and clone time. :-)

@vlsi
Copy link

vlsi commented Jul 1, 2022

jgit does not support shallow clones yet (see https://git.eclipse.org/r/c/jgit/jgit/+/193329 ), so the implementation would probably need to switch to the native git client.

I think it is reasonable to assume people would have git installed.

What if you change the branch configuration and had shallow=true

I would suggest adding an explicit parameter like 'fetchDepth: Int(ordepth: Int`, see https://github.com/actions/checkout#checkout-head)

@melix
Copy link
Owner

melix commented Jul 4, 2022

I am not particularly fond of the idea of re-inventing the wheel by implementing a wrapper on top of Git...

@vlsi
Copy link

vlsi commented Jul 4, 2022

I am not particularly fond of the idea of re-inventing the wheel by implementing a wrapper on top of Git...

Same here, however, I'm inclined jgit is too limited, so I am inclined that using git is better than jgit.


For reference, here's IDEA's reasoning regarding native git vs jgit: https://youtrack.jetbrains.com/issue/IDEABKL-5595/git4idea-switch-to-java-implementation-of-Git#focus=Comments-27-270524.0-0

I believe the following issues directly impact includegit even though includegit does not seem to demand much from git:

  • shallow clone
  • credential integrations

I've run into this issue when I tried using includegit for https://github.com/jlink/jqwik which unexpectedly stored all the documentation history committed under the default branch: jqwik-team/jqwik#370

@neilmarietta
Copy link

neilmarietta commented Nov 21, 2022

JGit added shallow clone support in version 6.3.

https://wiki.eclipse.org/JGit/New_and_Noteworthy/6.3

@vlsi
Copy link

vlsi commented Nov 21, 2022

6.x requires Java 11 :-(

@neilmarietta
Copy link

Is it an issue ?

@vlsi
Copy link

vlsi commented Nov 21, 2022

For instance, we keep https://github.com/pgjdbc/pgjdbc buildable with Java 8, so adding dependency on jgit which requires Java 11 would be problematic.

Even thought pgjdbc does not use includegit-gradle-plugin, we use jgit for creating/pushing git tags for the release purposes, so I'm inclined to use regular git client instead.

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

No branches or pull requests

4 participants