Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-13165

Cloning workspace loses hidden files/directories

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • core
    • None
    • Linux

      I upgraded to Jenkins 1.456 today, and now my jobs that use the Clone Workspace plugin are having problems because the workspace tar.gz that is created when the job completes no longer includes the .git directory. In 1.449, which I ended up downgrading back to, the default setting for files to include always pulls that in. I've verified this by running tar -tzf on the workspace.tar.gz; in 1.449 .git is there, in 1.456 it isn't.

      I wasn't able to force Jenkins to include it either. I tried putting "**/, **/.git" and other variations on that in the list of files to include, but none of them seemed to work.

          [JENKINS-13165] Cloning workspace loses hidden files/directories

          Owen Mehegan created issue -

          This is about dot files, not the hidden file flag in NTFS/FAT. Just to be sure.

          Kohsuke Kawaguchi added a comment - This is about dot files, not the hidden file flag in NTFS/FAT. Just to be sure.
          Owen Mehegan made changes -
          Assignee New: Kohsuke Kawaguchi [ kohsuke ]

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          test/src/test/java/hudson/FileSystemProvisionerTest.java
          http://jenkins-ci.org/commit/jenkins/2b5a24c9b0ec6c3f1feedde080aa3196f419ae40
          Log:
          JENKINS-13165 Added a test to reproduce the problem to no avail.

          Compare: https://github.com/jenkinsci/jenkins/compare/196aadc...2b5a24c

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: test/src/test/java/hudson/FileSystemProvisionerTest.java http://jenkins-ci.org/commit/jenkins/2b5a24c9b0ec6c3f1feedde080aa3196f419ae40 Log: JENKINS-13165 Added a test to reproduce the problem to no avail. Compare: https://github.com/jenkinsci/jenkins/compare/196aadc...2b5a24c

          As my commit indicates, I fail to reproduce this problem. Hmm.

          Kohsuke Kawaguchi added a comment - As my commit indicates, I fail to reproduce this problem. Hmm.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #1605
          JENKINS-13165 Added a test to reproduce the problem to no avail. (Revision 2b5a24c9b0ec6c3f1feedde080aa3196f419ae40)

          Result = SUCCESS
          Kohsuke Kawaguchi : 2b5a24c9b0ec6c3f1feedde080aa3196f419ae40
          Files :

          • test/src/test/java/hudson/FileSystemProvisionerTest.java

          dogfood added a comment - Integrated in jenkins_main_trunk #1605 JENKINS-13165 Added a test to reproduce the problem to no avail. (Revision 2b5a24c9b0ec6c3f1feedde080aa3196f419ae40) Result = SUCCESS Kohsuke Kawaguchi : 2b5a24c9b0ec6c3f1feedde080aa3196f419ae40 Files : test/src/test/java/hudson/FileSystemProvisionerTest.java

          I have the same problem. To reproduce it I downloaded 1.457, installed "Jenkins Git Plugin" and "Jenkins Clone Workspace SCM Plugin" and set up two Jobs as follows:

          • "GitJob" using a Git repository, then archiving the workspace and triggering the next job.
          • "CloneJob" using the previously archived workspace as SCM.

          CloneJob's workspace will not contain the Git files (.git directory as well as all .gitignore files). Other dot-files are unaffected (eg. Eclipse .project files will be present). As owenmehegan stated, Git files were present in previous Jenkins versions.

          Christoph Thelen added a comment - I have the same problem. To reproduce it I downloaded 1.457, installed "Jenkins Git Plugin" and "Jenkins Clone Workspace SCM Plugin" and set up two Jobs as follows: "GitJob" using a Git repository, then archiving the workspace and triggering the next job. "CloneJob" using the previously archived workspace as SCM. CloneJob's workspace will not contain the Git files (.git directory as well as all .gitignore files). Other dot-files are unaffected (eg. Eclipse .project files will be present). As owenmehegan stated, Git files were present in previous Jenkins versions.

          Some further details: The bug first appears in version 1.456; version 1.455 works fine. I even tested some older versions (1.449, 1.450, 1.454) which all work as expected. In all tests I used the same plugin versions (1.1.16 for Git and 0.4 for Clone Workspace).

          Christoph Thelen added a comment - Some further details: The bug first appears in version 1.456; version 1.455 works fine. I even tested some older versions (1.449, 1.450, 1.454) which all work as expected. In all tests I used the same plugin versions (1.1.16 for Git and 0.4 for Clone Workspace).

          For the records: Since Ant 1.8.2, Git files/directories (and those of other SCMs) are included in the "default excludes", which is why the files are lost in a cloned workspace. Therefore this is not a Jenkins "bug" but an Ant "feature". I have opened a pull request allowing the disabling of those default excludes. Plugins like Clone Workspace may use this to let Git files reappear.

          Christoph Thelen added a comment - For the records: Since Ant 1.8.2, Git files/directories (and those of other SCMs) are included in the "default excludes", which is why the files are lost in a cloned workspace. Therefore this is not a Jenkins "bug" but an Ant "feature". I have opened a pull request allowing the disabling of those default excludes. Plugins like Clone Workspace may use this to let Git files reappear.

          dogfood added a comment -

          Integrated in jenkins_ui-changes_branch #21
          JENKINS-13165 Added a test to reproduce the problem to no avail. (Revision 2b5a24c9b0ec6c3f1feedde080aa3196f419ae40)

          Result = SUCCESS
          Kohsuke Kawaguchi : 2b5a24c9b0ec6c3f1feedde080aa3196f419ae40
          Files :

          • test/src/test/java/hudson/FileSystemProvisionerTest.java

          dogfood added a comment - Integrated in jenkins_ui-changes_branch #21 JENKINS-13165 Added a test to reproduce the problem to no avail. (Revision 2b5a24c9b0ec6c3f1feedde080aa3196f419ae40) Result = SUCCESS Kohsuke Kawaguchi : 2b5a24c9b0ec6c3f1feedde080aa3196f419ae40 Files : test/src/test/java/hudson/FileSystemProvisionerTest.java

            kohsuke Kohsuke Kawaguchi
            owenmehegan Owen Mehegan
            Votes:
            5 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: