-
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
[JENKINS-49757] Git plugin calls fetch twice per checkout
Description |
Original:
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. [https://github.com/jenkinsci/git-client-plugin/blob/4241e818dbe27fb78093094f29ebcd2203166610/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java#L609] [https://github.com/jenkinsci/git-plugin/blob/cb58c74efafafd08bc03bba2787997c6a0272df0/src/main/java/hudson/plugins/git/GitSCM.java#L1153] I am aware there are needs to support for git clone to fetch all refs first [ Thanks, Sam |
New:
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. [https://github.com/jenkinsci/git-client-plugin/blob/4241e818dbe27fb78093094f29ebcd2203166610/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java#L609] [https://github.com/jenkinsci/git-plugin/blob/cb58c74efafafd08bc03bba2787997c6a0272df0/src/main/java/hudson/plugins/git/GitSCM.java#L1153] I am aware there are needs to support for git clone to fetch all refs first Thanks, Sam |
Assignee | Original: Mark Waite [ markewaite ] |
Description |
Original:
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. [https://github.com/jenkinsci/git-client-plugin/blob/4241e818dbe27fb78093094f29ebcd2203166610/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java#L609] [https://github.com/jenkinsci/git-plugin/blob/cb58c74efafafd08bc03bba2787997c6a0272df0/src/main/java/hudson/plugins/git/GitSCM.java#L1153] I am aware there are needs to support for git clone to fetch all refs first Thanks, Sam |
New:
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 first link is part of the Git-client clone step, it triggers the git-plugin CloneCommand (second link) to perform the clone operations. And afterwards, the Git-client plugin performs a fetch once cloneCommand Completes. However, within the cloneCommand (second link) itself, a fetch command was already done. [https://github.com/jenkinsci/git-client-plugin/blob/4241e818dbe27fb78093094f29ebcd2203166610/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java#L609] [https://github.com/jenkinsci/git-plugin/blob/cb58c74efafafd08bc03bba2787997c6a0272df0/src/main/java/hudson/plugins/git/GitSCM.java#L1153] I am aware there are needs to support for git clone to fetch all refs first - Thanks, Sam |
Description |
Original:
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 first link is part of the Git-client clone step, it triggers the git-plugin CloneCommand (second link) to perform the clone operations. And afterwards, the Git-client plugin performs a fetch once cloneCommand Completes. However, within the cloneCommand (second link) itself, a fetch command was already done. [https://github.com/jenkinsci/git-client-plugin/blob/4241e818dbe27fb78093094f29ebcd2203166610/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java#L609] [https://github.com/jenkinsci/git-plugin/blob/cb58c74efafafd08bc03bba2787997c6a0272df0/src/main/java/hudson/plugins/git/GitSCM.java#L1153] I am aware there are needs to support for git clone to fetch all refs first - Thanks, Sam |
New:
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. [https://github.com/jenkinsci/git-client-plugin/blob/4241e818dbe27fb78093094f29ebcd2203166610/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java#L609] [https://github.com/jenkinsci/git-plugin/blob/cb58c74efafafd08bc03bba2787997c6a0272df0/src/main/java/hudson/plugins/git/GitSCM.java#L1153] I am aware there are needs to support for git clone to fetch all refs first -- Thanks, Sam |
I appreciate the analysis very much.
Unfortunately, the analysis doesn't seem (to me) like evidence of a bug. The git plugin (your second link) uses the git client plugin (your first link) to perform the fetch. I don't see from your description that two fetch operations are being performed for each repository being cloned.
Please provide log output which shows two fetches being performed.
Since you've provided those call sites, I assume you could also include stack traces to show that a clone is being performed twice.