grgit
grgit copied to clipboard
Support submodule status
Please take a look at the issue (479048) I have filed jgit. Is there anything you can do in grgit (or perhaps a work-around) to help me out here? This is somewhat related to what you are working with. The purpose is to use git sha1 revisions as versions on artifacts. We use submodules to get the dependencies. So instead of doing a full git submodule update, we just retrieve the git sha1 revisions using git submodule status (or perhaps git ls-tree). But we would like to do it in groovy (gradle), not shell script.
Unfortunately, nothing is springing to mind. I haven't used submodules a lot personally.
The general goal of Grgit is to provide a better API to JGit from Groovy, so usually when JGit doesn't support anything, Grgit won't either. Just from an initial glance, I would think this would need to wait for JGit to provide a fix.
Confirming that the JGit bug is still open as of 10/22/2017.
alongside any known bugs, it is not possible to use Grgit.open(dir: submodulePath)
codepoints: https://github.com/ajoberstar/grgit/blob/master/src/main/groovy/org/ajoberstar/grgit/operation/OpenOp.groovy#L64
Expected: should work like
Git libModule = Git.open( new File( workDir, "modules/library" ) );
see also http://www.codeaffine.com/2014/04/16/how-to-manage-git-submodules-with-jgit/
I've committed a fix for a related bug here. The fix may address the one mentioned by OP as well, but I haven't verified.