jenkinsci / jenkinsci/git-plugin

[JENKINS-47870] git changelog compared to arbitrary reference

Open
#3,225 6 comments 0 reactions 0 assignees View on GitHub
component:git-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

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?

---
Originally reported by jekeller, imported from: git changelog compared to arbitrary reference


  • assignee: jekeller
  • status: In Progress
  • priority: Minor
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 3
  • watchers: 6
  • imported: 2025-12-02

Raw content of original issue

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.