grgit icon indicating copy to clipboard operation
grgit copied to clipboard

Support submodule status

Open thogr opened this issue 9 years ago • 4 comments

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.

thogr avatar Oct 06 '15 06:10 thogr

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.

ajoberstar avatar Oct 06 '15 23:10 ajoberstar

Confirming that the JGit bug is still open as of 10/22/2017.

ajoberstar avatar Oct 22 '17 20:10 ajoberstar

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 F‌ile( workDir, "modules/library" ) );

see also http://www.codeaffine.com/2014/04/16/how-to-manage-git-submodules-with-jgit/

childnode avatar Jan 04 '18 13:01 childnode

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.

vivin avatar Jul 28 '18 00:07 vivin