-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add support for using git
CLI when available
#1
base: main
Are you sure you want to change the base?
Conversation
JGit has some feature holes/defects -- in particular, it lacks support for git work-trees and has so for a long time. This adds initial support for using the git CLI when it is available, with support for falling back to JGit when not. This means features like work-trees are recognized and work properly. Changelog generation has not yet been moved to using GitProvider, as it requires more work to detach it from its use of JGit classes.
I can't grok proper array copying, so a collection it is!
git-symbolic-ref modifies the symbolic ref (first argument) to point to the second argument. A single argument, for a query, is what we want.
This might need a toggle/override. |
you can run external processes by using ExecOperations - and/or a custom ValueSource on a Provider |
You can't at the moment because the projects version property does not support it..... Even jgit currently throws up the error as it turns out. Because it invokes git as well |
I'm not fully sure what you mean by what isn't supported by the Although the project version property isn't a full |
If the configuration cache is enabled, using the git cli is isn't that hard - just use a ValueSource or two that takes an ExecOperations and call it a day. I'd recommend switching entirely to the git cli - if you use jgit sometimes and the git cli other times you risk inconsistent behavior causing weirdness |
IntelliJ IDEA refuses to work with any lower Gradle version, for some reason.
Remaining unimplemented change is removing GradleUtils.openGit, as that is currently used by ChangelogUtils.
The changelog generator value source will be migrated at a later date, due to its more extensive uses of JGit.
Inline `{@return}` is not in Java 8, which this project uses.
The git CLI provider still needs to implement the required method before it fully works, but the command needed is supplied in a comment for future work.
JGit has some feature holes/defects -- in particular, it lacks support for git work-trees and has so for a long time.
This PR adds support for using the
git
CLI when it is available, with support for falling back to JGit when not. This means features like work-trees are recognized and work properly.TODO
GitProvider
as wellGradleUtils
, due to removing the use of JGit classes.@CompileStatic
@CompileStatic
to more places in the project