-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
-
git plugin 4.4.0
When performing a git clone operation,
git-client and git-plugin both triggers a git fetch.
Below are the two lines of code running in the same git clone command both doing fetches.
The second link is part of the GITSCM step, it triggers the git-client-plugin's CloneCommand (first link) to perform the clone operation. And afterwards, the GITSCM step performs a fetch once the CloneCommand Completes.
However, within the CloneCommand (first link) itself, a fetch command was already done.
I am aware there are needs to support for git clone to fetch all refs first --. The suggestion provided in that ticket was to use "honor git refspec", so shouldn't "honor git refspec" skip the first fetch here?JENKINS-31393
Thanks,
Sam
- is related to
-
JENKINS-56404 Impossible exclude redundant/double fetches
-
- Closed
-
- links to
I think I see the same behavior in the log file of my jobs. I have a Freestyle job configured which generates the following log output:
That shows two calls are made to git fetch. Since git fetch is an incremental operation, I'm not planning to make any change in this area of the code. The second fetch operation is not free, but it is usually very lightweight, since it will only request changes made since the preceding fetch.
For the sake of precision, your earlier comments are not describing the implementation of the code. You said:
As far as I can tell, that's not the way the code works. The git client plugin does not call the git plugin. It does not have any dependency on the git plugin and does not know about the git plugin implementation. The git client plugin provides an API that is called by the git plugin.
The stack trace you provided shows two calls to git fetch, but the two calls are using different credentials. I'm assuming that the difference in credentials is because you edited the log output to remove identifying information.