| Issue 3411: | git commit of meta/config:meta/config not committed within the git remote All-Projects.git repo using java jgit client | |
| 1 person starred this issue and may be notified of changes. | Back to list |
***************************************************************** ***** ***** ***** !!!! THIS BUG TRACKER IS FOR GERRIT CODE REVIEW !!!! ***** ***** ***** ***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, CYANOGENMOD, ***** ***** INTERNAL ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC.***** ***** ***** ***** THOSE ISSUES BELONG IN DIFFERENT ISSUE TRACKERS ***** ***** ***** ***************************************************************** Affected Version: 2.11 What steps will reproduce the problem? 1. Clone the github project : https://github.com/cmoulliard/gerrit-create-adminuser-plugin 2. Within a unix terminal, generate the gerrit site using the script bin/generate.sh 3. Start gerrit server with a remote debugger (prt 5005) using ./bin/debug_start.sh 4. Run your remote debugger in Intellij or eclipse (optional if you would like to debug the class Receive or AsyncReceiveCommits 5. Run the java main method of com.googlesource.gerrit.plugins.admin.JGitClient What is the expected output? Commit should be pushed to the remote All.Projects.git repo created under target/gerrit-site/git/All-Projects.git like it works with git command executed in a terminal ffb79a0 2015-06-05 Administrator (HEAD, meta/config) REPLACE OLD WITH NEW FILE 8ae4bcb 2015-06-05 Gerrit Code Review (origin/meta/config) Initialized Gerrit Code Review 2.11 What do you see instead? No commit pushed . Only the initial commit appears when the site has been generated /target/gerrit-site/git/All-Projects.git$ gitlog ab49d07 2015-06-05 Gerrit Code Review (HEAD, refs/meta/config) Initialized Gerrit Code Review 2.11 Please provide any additional information below. The use case + screenshots is described here : https://groups.google.com/forum/#!topic/repo-discuss/F-guwXN_PW0 I have tested with git commands described hereafter and that works : cd target rm -rf mytestgit mkdir -p mytestgit cd mytestgit git init git config user.name "Administrator" git config user.email "admin@example.com" git remote add origin "ssh://admin@localhost:29418/All-Projects" git fetch origin refs/meta/config:refs/remotes/origin/meta/config git checkout meta/config gitlog cp ../../config/project.config . git commit -m "REPLACE OLD WITH NEW FILE" -a git push origin meta/config:meta/config gitlog git status
Jun 5, 2015
I have already tried what you proposed but I get this error with such refs
java.lang.IllegalStateException: Unable to push into remote Git repository
at
com.googlesource.gerrit.plugins.admin.JGitClient.pushChange(JGitClient.java:209)
at com.googlesource.gerrit.plugins.admin.JGitClient.main(JGitClient.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: org.eclipse.jgit.api.errors.JGitInternalException: Exception
caught during execution of push command
at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:178)
at
com.googlesource.gerrit.plugins.admin.JGitClient.pushChange(JGitClient.java:192)
... 6 more
Caused by: java.io.IOException: Source ref refs/meta/config doesn't resolve
to any object.
at
org.eclipse.jgit.transport.RemoteRefUpdate.<init>(RemoteRefUpdate.java:288)
at
org.eclipse.jgit.transport.RemoteRefUpdate.<init>(RemoteRefUpdate.java:192)
at
org.eclipse.jgit.transport.Transport.findRemoteRefUpdatesFor(Transport.java:646)
at
org.eclipse.jgit.transport.Transport.findRemoteRefUpdatesFor(Transport.java:1269)
at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:152)
Nevertheless, that works with this refs_spec definition --> RefSpec
refSpec = new RefSpec("meta/config:refs/meta/config");
Jun 5, 2015
I propose to close the ticket.
Question : Why do I get a response ("status = OK") while in fact no commit was published into the target git hub repo 'All-Projects.git' ?
Jun 5, 2015
(No comment was entered for this change.)
Status:
Invalid
|
|
| ► Sign in to add a comment |
RefSpec refSpec = new RefSpec("meta/config:meta/config"); ? Did you try: RefSpec refSpec = new RefSpec("refs/meta/config:refs/meta/config"); ?