[JIRA] [git-plugin] (JENKINS-33140) Git plugin doesn't use refspec on the first clone/fetch

1 view
Skip to first unread message

cuong.tran@gmail.com (JIRA)

unread,
Feb 24, 2016, 7:24:02 PM2/24/16
to jenkinsc...@googlegroups.com
Cuong Tran created an issue
 
Jenkins / Bug JENKINS-33140
Git plugin doesn't use refspec on the first clone/fetch
Issue Type: Bug Bug
Assignee: Mark Waite
Components: git-plugin
Created: 25/Feb/16 12:23 AM
Environment: Jenkins ver. 1.649
Git plugin 2.4.2
Priority: Minor Minor
Reporter: Cuong Tran

Our repositories have lots of references and we only need to build from a single branch from each job. For example, I have a job with refspec +refs/heads/master:refs/remotes/origin/master.

On the first clone, it does the following:

Cloning the remote Git repository
Using shallow clone
Avoid fetching tags
Cloning repository https://github.com/foo.git
> git init /tmp/jenkins/slave1/workspace/sample/smoke-test # timeout=10
Fetching upstream changes from https://github.com/foo.git
> git --version # timeout=10
> git -c core.askpass=true fetch --no-tags --progress https://github.com/foo.git +refs/heads/:refs/remotes/origin/ --depth=1 # timeout=10

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

cuong.tran@gmail.com (JIRA)

unread,
Feb 24, 2016, 7:25:03 PM2/24/16
to jenkinsc...@googlegroups.com
Cuong Tran updated an issue
Change By: Cuong Tran
Our repositories have lots of references and we only need to build from a single branch from each job.  For example, I have a job with refspec +refs/heads/master:refs/remotes/origin/master.  

On the first clone, it does the following:

Cloning the remote Git repository
Using shallow clone
Avoid fetching tags
Cloning repository https://github.com/foo.git
 > git init /tmp/jenkins/slave1/workspace/sample/smoke-test # timeout=10
Fetching upstream changes from https://github.com/foo.git
 > git --version # timeout=10
 > git -c core.askpass=true fetch --no-tags --progress https://github.com/foo.git +refs/heads/* * :refs/remotes/origin/* *  --depth=1 # timeout=10

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

unread,
Mar 5, 2016, 5:58:02 PM3/5/16
to jenkinsc...@googlegroups.com
Mark Waite assigned an issue to Unassigned
Change By: Mark Waite
Assignee: Mark Waite

timocov@gmail.com (JIRA)

unread,
Apr 16, 2016, 6:34:02 PM4/16/16
to jenkinsc...@googlegroups.com

timocov@gmail.com (JIRA)

unread,
Apr 16, 2016, 6:35:01 PM4/16/16
to jenkinsc...@googlegroups.com
Eugene Timokhov closed an issue as Duplicate
 
Change By: Eugene Timokhov
Status: Open Closed
Resolution: Duplicate

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

unread,
Jul 1, 2016, 8:35:01 PM7/1/16
to jenkinsc...@googlegroups.com
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

javibm6@gmail.com (JIRA)

unread,
Mar 3, 2017, 7:33:03 AM3/3/17
to jenkinsc...@googlegroups.com
Javier Agüera reopened an issue
 

Hey,

I'm getting the same exactly bug with version 3.0.5 and Jenkins: 2.32.2.

The steps to reproduce the issue are the same.

Is it possible to have a regression here?

Thanks.

Change By: Javier Agüera
Resolution: Duplicate
Status: Closed Reopened

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

unread,
Mar 3, 2017, 8:00:04 AM3/3/17
to jenkinsc...@googlegroups.com
Mark Waite resolved as Fixed
 

What you're seeing is not a regression. It is an intentional choice that the default behavior had to remain compatible with the behavior which caused this bug report and JENKINS-31393.

One or more use cases depended on the bug that the default initial fetch retrieved all refspecs, even if a refspec was provided. I was unable to find any way to make those use cases work other than to leave the default behavior as it was before this bug was fixed.

Users who need to honor the refspec on initial clone will need to modify their job definition to add that to the job definition. The "Advanced clone behaviours" available in the "Add" button of the git plugin configuration section now includes a check box "Honor refspec on initial clone". You need to check that box for all jobs where you want to honor refspec on initial clone.

Change By: Mark Waite
Status: Reopened Resolved
Resolution: Fixed

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

unread,
Oct 22, 2019, 9:33:01 PM10/22/19
to jenkinsc...@googlegroups.com
Mark Waite closed an issue as Fixed
Change By: Mark Waite
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages