• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • None

      I have use-case where I have a repository with multiple submodules, connected to Gerrit review system. I have a jenkins job which runs for when someone submits a review commit to a submodule. I want to checkout the parent job at master, and checkout the submodule at the gerrit commit id.

      I'd like to be able to compare the new gerrit id submodule commit against the commit as recorded inside the submodule.

       

      Using pipeline, I'm able to determine the commit id of the submodule as tracked in the parent, and pass that to the ChangeLogToBranch extension. Unfortunately, this extension does some munging on the input and assumes it is a branch name accessible to the remote, which results in the following output:

      Using 'Changelog to branch' strategy. fatal: bad revision '^origin/850642c1cbc8961413c400c0b5fcfbfdaff3c4d6' ERROR: Unable to retrieve changeset hudson.plugins.git.GitException: Error launching git whatchanged at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$6.execute(CliGitAPIImpl.java:907) at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153) at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146) at hudson.remoting.UserRequest.perform(UserRequest.java:153) at hudson.remoting.UserRequest.perform(UserRequest.java:50) at hudson.remoting.Request$2.run(Request.java:336) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) at ......remote call to ND-CI-Fedora27-beta(Native Method) at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1545) at hudson.remoting.UserResponse.retrieve(UserRequest.java:253) at hudson.remoting.Channel.call(Channel.java:830) at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146) at sun.reflect.GeneratedMethodAccessor213.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132) at com.sun.proxy.$Proxy77.execute(Unknown Source) at hudson.plugins.git.GitSCM.computeChangeLog(GitSCM.java:1264) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1176) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47) at hudson.security.ACL.impersonate(ACL.java:260) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:748)

       

      I'm guessing changes to ChangelogToBranch to not interpret (or at least not always interpret) the argument as a valid branch would not be acceptable? Maybe another extension which supports arbitrary local references?

          [JENKINS-47870] git changelog compared to arbitrary reference

          Jacob Keller added a comment -

          I've got  a solution as an extra extension "ChangelogToRev" which can ultimately replace the ChangelogToBranch by simply allowing arbitrary git revisions instead of limiting ourselves to branches. (Though I chose to simply add it as an option). I will be submitting a pull request soon.

          Jacob Keller added a comment - I've got  a solution as an extra extension "ChangelogToRev" which can ultimately replace the ChangelogToBranch by simply allowing arbitrary git revisions instead of limiting ourselves to branches. (Though I chose to simply add it as an option). I will be submitting a pull request soon.

          Mor L added a comment -

          Hi,

          Did you submit the PR eventually?

          I came across the same situation where I need to calculate the changelog against a specific commit hash which is not a branch but is guaranteed to be on the same history path of the current checkout (as in it can be calculated after the checkout locally).

          Would be nice if you can update.

          Thanks

          Mor

          Mor L added a comment - Hi, Did you submit the PR eventually? I came across the same situation where I need to calculate the changelog against a specific commit hash which is not a branch but is guaranteed to be on the same history path of the current checkout (as in it can be calculated after the checkout locally). Would be nice if you can update. Thanks Mor

          Jacob Keller added a comment -

          I have submitted https://github.com/jenkinsci/git-plugin/pull/552 though I have not heard anything back from the maintainer.

          Jacob Keller added a comment - I have submitted https://github.com/jenkinsci/git-plugin/pull/552  though I have not heard anything back from the maintainer.

          Mark Waite added a comment -

          Sorry, spent the Thanksgiving weekend on a different bug report.

          Mark Waite added a comment - Sorry, spent the Thanksgiving weekend on a different bug report.

          ipleten added a comment -

          Is there any update  on this? I need to get diff between two tags 

          ipleten added a comment - Is there any update  on this? I need to get diff between two tags 

          Mark Waite added a comment - - edited

          No progress, sorry, and none likely until after the release of git plugin 4.0.0 and git client plugin 3.0.0. Once those are released, I'll look again at the grouping and priority of pull requests in the plugin. Current priorities are listed as:

          1. BuildData bloat
          2. notifyCommit improvements
          3. Submodule improvements
          4. Caching enhancements
          5. Changelog improvements (including this one)

          Mark Waite added a comment - - edited No progress, sorry, and none likely until after the release of git plugin 4.0.0 and git client plugin 3.0.0. Once those are released, I'll look again at the grouping and priority of pull requests in the plugin. Current priorities are listed as: BuildData bloat notifyCommit improvements Submodule improvements Caching enhancements Changelog improvements (including this one)

            jekeller Jacob Keller
            jekeller Jacob Keller
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: