[JIRA] (JENKINS-59794) Using a period as the branch name in .gitModules does not work.

0 views
Skip to first unread message

captrespect@gmail.com (JIRA)

unread,
Oct 15, 2019, 7:28:03 PM10/15/19
to jenkinsc...@googlegroups.com
Jon Roberts created an issue
 
Jenkins / Bug JENKINS-59794
Using a period as the branch name in .gitModules does not work.
Issue Type: Bug Bug
Assignee: Mark Waite
Components: git-plugin
Created: 2019-10-15 19:27
Priority: Minor Minor
Reporter: Jon Roberts

When you specify the branch name as a '.' (period) in .gitModules you should be able to use the --remote option to update submodules to the head the branch that matches the parent branch.

When doing this in Jenkins we get the following error: 

hudson.plugins.git.GitException: Command "/usr/bin/git submodule update --init --recursive --remote curavi-common" returned status code 1:
stdout: 
stderr: Cloning into 'curavi-common'...
fatal: Needed a single revision
Unable to find current origin/. revision in submodule path 'curavi-common'	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2042)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1761)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$400(CliGitAPIImpl.java:72)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$7.execute(CliGitAPIImpl.java:1202)
	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:212)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:369)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	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)
Caused: java.io.IOException: Could not perform submodule update
	at hudson.plugins.git.extensions.impl.SubmoduleOption.onCheckoutCompleted(SubmoduleOption.java:113)
	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1270)
	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:1818)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE

Example .gitModule:

[submodule "curavi-common"]
    path = curavi-common
    url = g...@bitbucket.org:curavihealth/curavi-common.git
    branch = .

I've check the 'Update tracking submodules to tip of branch' option under "Advanced sub-module behaviors.

I'm expecting the job to clone my parent project and then get the HEAD of submodule with the same branch name. Locally this works by running 'git submodule update --remote'  However this fails with the stack trace above.

Thanks!

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

mark.earl.waite@gmail.com (JIRA)

unread,
Oct 15, 2019, 9:20:03 PM10/15/19
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Oct 15, 2019, 9:20:03 PM10/15/19
to jenkinsc...@googlegroups.com
Mark Waite assigned an issue to Unassigned
Change By: Mark Waite
Assignee: Mark Waite

mark.earl.waite@gmail.com (JIRA)

unread,
Oct 31, 2019, 9:39:03 PM10/31/19
to jenkinsc...@googlegroups.com
Mark Waite commented on Bug JENKINS-59794
 
Re: Using a period as the branch name in .gitModules does not work.

The special value of '.' depends on command line git 2.10 or later (at least according to the documentation at https://git-scm.com/docs/git-submodule/2.10.2 and at https://git-scm.com/docs/git-submodule/2.9.0 . If this is implemented, it will need to be safeguarded so that it is only used if the CLI git version is new enough to support it.

Many popular operating systems do no ship git 2.10 or newer (CentOS 6,. CentOS 7, Ubuntu 16.04) and the plugins generally try to not break those older versions.

captrespect@gmail.com (JIRA)

unread,
Nov 6, 2019, 7:07:02 PM11/6/19
to jenkinsc...@googlegroups.com

That's good to know.  I'm running 2.16.2 on windows, so it should work.  I'll update to the latest and give it a shot to see if that fixes it once I get a chance.

mark.earl.waite@gmail.com (JIRA)

unread,
Nov 6, 2019, 7:13:02 PM11/6/19
to jenkinsc...@googlegroups.com

Jon Roberts I don't expect it to work with the Jenkins git plugin. The Jenkins git plugin performs git submodule operations in its own distinct way. One of the differences from the most recent command line git versions is likely the handling of the '.' special case.

captrespect@gmail.com (JIRA)

unread,
Nov 6, 2019, 7:22:03 PM11/6/19
to jenkinsc...@googlegroups.com

Actually looking at my stacktrace again I noticed it's not a windows path and forgot this was running on a linux agent.  That agent has git 2.7.4.   I'll hold out some hope since it looks like it's just running straight up git.


/usr/bin/git submodule update --init --recursive --remote curavi-common" returned status code 1:

mark.earl.waite@gmail.com (JIRA)

unread,
Nov 6, 2019, 8:37:02 PM11/6/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages