Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-53725

git-plugin cannot operate on a git-worktree

XMLWordPrintable

    • git plugin 4.0.0 and git client plugin 3.0.0

      Core issue: JGit doesn't support git-worktree yet.
      Trigger: git-plugin tries to retrieve the commit message via JGit in order to print it to the log, fails the build on error
      Possible short-term solution: make printing the commit message optional
      Possible short-term solution: make errors while printing the commit message not fail the build
      Possible long-term solution: fix JGit to support git-worktree
      Possible long-term solution: stop using JGit

      Stack trace:

       > git checkout -f 22ae7e760b087f56426e764b5762ec58506dba04
      org.eclipse.jgit.errors.MissingObjectException: Missing unknown 22ae7e760b087f56426e764b5762ec58506dba04
      	at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:158)
      	at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:227)
      	at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:859)
      	at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:772)
      	at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:25)
      	at hudson.plugins.git.util.RevCommitRepositoryCallback.invoke(RevCommitRepositoryCallback.java:13)
      	at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:72)
      	at hudson.plugins.git.GitSCM.printCommitMessageToLog(GitSCM.java:1271)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1244)
      	at hudson.scm.SCM.checkout(SCM.java:504)
      	at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
      	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
      	at hudson.model.Run.execute(Run.java:1806)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:429)
      

      This previously worked. Likely up to git-plugin 3.3.0.
      If I add a catch clause for org.eclipse.jgit.errors.MissingObjectException, rebuild and install the plugin, I can run my build.

            Unassigned Unassigned
            tomylobo T L
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: