Community
Participate
Working Groups
From what I understood jgit currently does not support support ls-remote[1]. It would be really helpfull if jgit would support this command. [1] http://www.kernel.org/pub/software/scm/git/docs/git-ls-remote.html
Created attachment 194039 [details] LsRemoteCommand.java Initial attempt at implementing ls-remote. It seems to work but filtering for tags does not work. It seems like a bug in FetchProcess where the "Set<Ref> matched" is filled but never used. Or maybe I'm doing it wrong? My simple test program is: Repository repo = new FileRepository("jgit/.git"); LsRemoteCommand lsRemoteCommand = new LsRemoteCommand(repo); lsRemoteCommand.setTags(true); FetchResult call = lsRemoteCommand.call(); for (Ref s : call.getAdvertisedRefs()) { System.out.println(s); }
Created attachment 194699 [details] LsRemoteCommand.java Working implementation
Created attachment 194700 [details] LsRemoteResult.java Necessary return object
Can you contribute these two patches via Gerrit? http://wiki.eclipse.org/EGit/Contributor_Guide#Contributing_Patches
Generally tests are helpful too.
I pushed a patch here: http://egit.eclipse.org/r/3346 Please review it if it meets your needs.
merged into master as e170c314fb96977650d69f7af206d84a362126be. Also added a LsRemoteCommandTest. Thanks for your contribution Christoph!