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

          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

          Code changed in jenkins
          User: Christoph Thelen
          Path:
          changelog.html
          core/src/main/java/hudson/util/DirScanner.java
          core/src/test/java/hudson/util/DirScannerTest.java
          http://jenkins-ci.org/commit/jenkins/0725d2765da789e02914deb4893a449eeda6a820
          Log:
          [FIXED JENKINS-13165] Allow plugins to disable usage of Ant default excludes.

          This is also related to JENKINS-9778.

          Compare: https://github.com/jenkinsci/jenkins/compare/3c349c0...0725d27

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Thelen Path: changelog.html core/src/main/java/hudson/util/DirScanner.java core/src/test/java/hudson/util/DirScannerTest.java http://jenkins-ci.org/commit/jenkins/0725d2765da789e02914deb4893a449eeda6a820 Log: [FIXED JENKINS-13165] Allow plugins to disable usage of Ant default excludes. This is also related to JENKINS-9778 . Compare: https://github.com/jenkinsci/jenkins/compare/3c349c0...0725d27

          dogfood added a comment -

          Integrated in jenkins_main_trunk #1681

          Result = SUCCESS

          dogfood added a comment - Integrated in jenkins_main_trunk #1681 Result = SUCCESS

          dogfood added a comment -

          Integrated in jenkins_ui-changes_branch #26
          [FIXED JENKINS-13165] Allow plugins to disable usage of Ant default excludes. (Revision 0725d2765da789e02914deb4893a449eeda6a820)

          Result = SUCCESS
          Kohsuke Kawaguchi : 0725d2765da789e02914deb4893a449eeda6a820
          Files :

          • core/src/test/java/hudson/util/DirScannerTest.java
          • core/src/main/java/hudson/util/DirScanner.java
          • changelog.html

          dogfood added a comment - Integrated in jenkins_ui-changes_branch #26 [FIXED JENKINS-13165] Allow plugins to disable usage of Ant default excludes. (Revision 0725d2765da789e02914deb4893a449eeda6a820) Result = SUCCESS Kohsuke Kawaguchi : 0725d2765da789e02914deb4893a449eeda6a820 Files : core/src/test/java/hudson/util/DirScannerTest.java core/src/main/java/hudson/util/DirScanner.java changelog.html

          Code changed in jenkins
          User: Olivier Lamy
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/d7d9cf4a8618e777c2303aec010f5443f13aeaf6
          Log:
          changelog entry for JENKINS-13165

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: changelog.html http://jenkins-ci.org/commit/jenkins/d7d9cf4a8618e777c2303aec010f5443f13aeaf6 Log: changelog entry for JENKINS-13165

          Henrik Skupin added a comment -

          A pull request is up on github for 2 months now. Could anyone with privileges please check it and get landed if appropriate? Our work is massively blocked on a new version of this plugin.

          https://github.com/jenkinsci/jenkins-clone-workspace-scm-plugin/commit/0bfecdad2fddc44c43b96f88ed373ab225e330e6

          Thanks a lot!

          Henrik Skupin added a comment - A pull request is up on github for 2 months now. Could anyone with privileges please check it and get landed if appropriate? Our work is massively blocked on a new version of this plugin. https://github.com/jenkinsci/jenkins-clone-workspace-scm-plugin/commit/0bfecdad2fddc44c43b96f88ed373ab225e330e6 Thanks a lot!

          Antoine Musso added a comment -

          I have opened JENKINS-14355 about the fingerprint plugin not being able to fingerprint ".git/FETCH_HEAD. I believe it is a similar issue as dirscanner fixed by https://github.com/jenkinsci/jenkins/commit/0725d2765da789e02914deb4893a449eeda6a820#L1R102 but with Util.createFileSet() this time.

          Antoine Musso added a comment - I have opened JENKINS-14355 about the fingerprint plugin not being able to fingerprint ".git/FETCH_HEAD. I believe it is a similar issue as dirscanner fixed by https://github.com/jenkinsci/jenkins/commit/0725d2765da789e02914deb4893a449eeda6a820#L1R102 but with Util.createFileSet() this time.

          Dave Hunt added a comment -

          Please correct me if I'm wrong, but I believe this was fixed by JENKINS-13888

          Dave Hunt added a comment - Please correct me if I'm wrong, but I believe this was fixed by JENKINS-13888

          Henrik Skupin added a comment -

          I tested this with the last Jenkins LTS version (1.509.2) and the Jenkins Clone Workspace SCM Plug-in version 0.5. Everything works fine now and the hidden files are included in the workspace archive. So this is indeed fixed!

          Thanks!

          Henrik Skupin added a comment - I tested this with the last Jenkins LTS version (1.509.2) and the Jenkins Clone Workspace SCM Plug-in version 0.5. Everything works fine now and the hidden files are included in the workspace archive. So this is indeed fixed! Thanks!

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

              Created:
              Updated:
              Resolved: