jenkinsci / jenkinsci/git-plugin

[JENKINS-38642] disabling shallow cloning leaves a shallow clone

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

Description

If you have a shallow clone enabled for a repository, then disable it, any existing workspaces still have a shallow clone even though this is disabled. This means the state of the job is out of sync with the state of the config, and ideally git-plugin should detect a shallow clone and re-clone in this case, otherwise it is a lot of work to figure out this is what is happening (after all, you probably disabled it because you need a full clone so you are immediately going to run into this if you disable it) and delete the workspace for any and all jobs and nodes that have it cloned.

Thanks for any consideration!

---
Originally reported by mcrooney, imported from: disabling shallow cloning leaves a shallow clone


  • status: Open
  • priority: Minor
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 2025-12-02

Raw content of original issue

If you have a shallow clone enabled for a repository, then disable it, any existing workspaces still have a shallow clone even though this is disabled. This means the state of the job is out of sync with the state of the config, and ideally git-plugin should detect a shallow clone and re-clone in this case, otherwise it is a lot of work to figure out this is what is happening (after all, you probably disabled it because you need a full clone so you are immediately going to run into this if you disable it) and delete the workspace for any and all jobs and nodes that have it cloned.

Thanks for any consideration!

  • environment: Jenkins 2.7.4, git-plugin 2.5.2

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.