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

Use JGit/EGit or the gradle-git plugin instead of native Git #27

Closed
miho opened this issue Mar 29, 2016 · 8 comments
Closed

Use JGit/EGit or the gradle-git plugin instead of native Git #27

miho opened this issue Mar 29, 2016 · 8 comments
Assignees
Milestone

Comments

@miho
Copy link

miho commented Mar 29, 2016

Not every developer has a native git executable in the path. If that's the case, the build.gradle file will fail with an exception. Telling developers/users to install yet another tool does not simplify the build process ;) IDEs such as Netbeans and Eclipse use a Java based Git infrastructure which works nicely in many cases. Another problem with native Git might be compatibility. Although the git repository-format is pretty stable, the native CLI might be incompatible with this plugin. IT is complicated to force a specific, well-tested git-version Therefore, I'm suggesting a switch from native Git to JGit/EGit or the gradle-git plugin.

@dcoraboeuf
Copy link
Contributor

Hi Michael,

I'll have a look at https://github.com/ajoberstar/grgit.

Best regards,
Damien.

@dcoraboeuf dcoraboeuf added this to the 1.7 milestone Mar 31, 2016
@miho
Copy link
Author

miho commented Apr 10, 2016

Hi Damien,

thanks for your response. Does that mean you will switch to grgit? Would be great! In the meantime I will use it directly.

Regards,
Michael

@dcoraboeuf
Copy link
Contributor

Hi Michael,

I'll probably use either grgit or jgit (done that in my other projects - but I'm using git describe and it's not available in JGit). I'll try to find some time to do the changes :)

Best regards,
Damien

@miho
Copy link
Author

miho commented Apr 15, 2016

Thanks!

@dcoraboeuf dcoraboeuf self-assigned this Apr 15, 2016
@dcoraboeuf
Copy link
Contributor

As I feared, the describe command is not complete in either grgit or jgit. The current version of the code of the plugin uses git describe --tags --exact-match --always HEAD in order to know if we are exactly on a tag or not. Those flags are not available in either grgit or jgit.

I have to find another way to get this information.

dcoraboeuf added a commit that referenced this issue Apr 15, 2016
dcoraboeuf added a commit that referenced this issue Apr 16, 2016
@dcoraboeuf
Copy link
Contributor

In the end, I'm using the long version (--long) of the describe command and parse the result to know if I'm on a tag.

dcoraboeuf added a commit that referenced this issue Apr 16, 2016
…lt to extract exact tag - more details in case of error
dcoraboeuf added a commit that referenced this issue Apr 16, 2016
dcoraboeuf added a commit that referenced this issue Apr 16, 2016
dcoraboeuf added a commit that referenced this issue Apr 16, 2016
…not take into account - removed an obsolete test
dcoraboeuf added a commit that referenced this issue Apr 16, 2016
@dcoraboeuf
Copy link
Contributor

Available in version 1.7.0 - published in Bintray, can take some time (< one hour) before it's available. Note that I keep using the git binary for testing the versioning plugin itself, but no longer at runtime.

@delanym
Copy link

delanym commented Jan 7, 2020

What a pity! Please make this optional, like in Maven's git-commit-id plugin. Why would I want to use JGit when native git is available and MUCH faster?
See git-commit-id/git-commit-id-maven-plugin#462

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

No branches or pull requests

3 participants