Community
Participate
Working Groups
I can successfully use JGit to push to GIT, GIT to JGit and GIT to GIT. Thus the following three commands work: sh org.eclipse.jgit.pgm-0.10.1.sh push --receive-pack=/path/to/git-receive-pack host:path ref git push --receive-pack= "sh org.eclipse.jgit.pgm-0.10.1.sh receive-pack" host:path ref git push --receive-pack=/path/to/git-receive-pack host:path ref But if I try to push from JGit to JGit using sh org.eclipse.jgit.pgm-0.10.1.sh push --receive-pack "sh org.eclipse.jgit.pgm-0.10.1.sh receive-pack" host:path ref I get: org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during execution of push command at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:148) at org.eclipse.jgit.pgm.Push.run(Push.java:123) at org.eclipse.jgit.pgm.TextBuiltin.execute(TextBuiltin.java:13 9) at org.eclipse.jgit.pgm.Main.execute(Main.java:191) at org.eclipse.jgit.pgm.Main.run(Main.java:120) at org.eclipse.jgit.pgm.Main.main(Main.java:94) Caused by: org.eclipse.jgit.errors.TransportException: carver:download/gromacs.threading: push not permitted at org.eclipse.jgit.transport.BasePackPushConnection.noReposito ry(BasePackPushConnection.java:149) at org.eclipse.jgit.transport.BasePackConnection.readAdvertised RefsImpl(BasePackConnection.java:198) at org.eclipse.jgit.transport.BasePackConnection.readAdvertised Refs(BasePackConnection.java:176) at org.eclipse.jgit.transport.TransportGitSsh$SshPushConnection . <init>(TransportGitSsh.java:468) at org.eclipse.jgit.transport.TransportGitSsh.openPush(Transpor tGitSsh.java:109) at org.eclipse.jgit.transport.PushProcess.execute(PushProcess.j ava:130) at org.eclipse.jgit.transport.Transport.push(Transport.java:962 ) at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:144) ... 5 more I seems that jgit receive pack doesn't send the possible refs. It from when pushing from GIT because it doesn't require this. But jgit requires to receive a list of possible refs. Reproducible: always Version: both 0.10.1 and latest HEAD version from today.
(In reply to comment #0) > But if I try to push from JGit to JGit using > sh org.eclipse.jgit.pgm-0.10.1.sh push --receive-pack "sh > org.eclipse.jgit.pgm-0.10.1.sh receive-pack" host:path ref The problem is JGit's LocalTransport spawn() method doesn't split the getReceivePack() option string. It is passing the entire string as-is as the program to execute. And of course you do not have a program called "sh<space>org.eclipse.jgit.pgm-0.10.1.sh" in your $PATH, so this fails. CGit must be passing this string through the local shell with sh -c, so we need to fix JGit to do the same. I've uploaded http://egit.eclipse.org/r/2416 as a possible fix.
(In reply to comment #1) > (In reply to comment #0) > > But if I try to push from JGit to JGit using > > sh org.eclipse.jgit.pgm-0.10.1.sh push --receive-pack "sh > > org.eclipse.jgit.pgm-0.10.1.sh receive-pack" host:path ref > > The problem is JGit's LocalTransport spawn() method doesn't split the > getReceivePack() option string. It is passing the entire string as-is as the > program to execute. And of course you do not have a program called > "sh<space>org.eclipse.jgit.pgm-0.10.1.sh" in your $PATH, so this fails. > > CGit must be passing this string through the local shell with sh -c, so we need > to fix JGit to do the same. > > I've uploaded http://egit.eclipse.org/r/2416 as a possible fix. This fixes it for local push. It still doesn't work for push over SSH.
Fixed in stable-0.11, will be part of the release when we ship next week.
(In reply to comment #3) > Fixed in stable-0.11, will be part of the release when we ship next week. As already wrote in comment #2: this only fixes it for the local transport. Thus jgit.sh push --receive-pack "jgit.sh receive-pack" $HOME/g2 master is fixed in stable-0.11. But jgit.sh push --receive-pack "jgit.sh receive-pack" localhost:g2 master still doesn't work.
Change http://egit.eclipse.org/r/2435 resolves this for SSH.