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

git-client explicitly setting core.symlinks in .git/config

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: git-client-plugin
    • Labels:
      None
    • Environment:
      # uname -a
      Linux brassett-02 3.2.0-30-virtual #48-Ubuntu SMP Fri Aug 24 17:12:24 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

      # cat /etc/issue
      Ubuntu 12.04.2 LTS \n \l
    • Similar Issues:

      Description

      We recently upgraded the git-client and jenkins Git plugins to the latest versions.

      We have several projects that contain symlinks that are checked directly into git.

      When testing using vanilla git on the commandline, the repo is created correctly either using 'git clone' or 'git init/git fetch'. The base .git/config file looks like this:

      [core]
      repositoryformatversion = 0
      filemode = true
      bare = false
      logallrefupdates = true

      However, cloning this same repo using the Jenkins plugins yields the following base config file:

      [core]
      symlinks = false
      repositoryformatversion = 0
      filemode = true
      logallrefupdates = true

      The result is that our symlinks end up being local text files with references to the file it's supposed to link to, so those builds fail.

      This appears to be a similar issue to https://issues.jenkins-ci.org/browse/JENKINS-21168, except on the Linux platform. I don't believe core.symlinks should be set at all on Linux, generally speaking.

      I tried starting the slave agent with JAVA_ARGS=-Dorg.jenkinsci.plugins.gitclient.Git.useCLI=true

      but I get the same results.

      If I'm reading the Windows version of this bug correctly, I think it's using JGit to create the initial repo, regardless of what we set in the JAVA_ARGS. Perhaps the bug lies there.

      It's also worth noting that we don't even have a JGit instance defined.

      We've worked around it by not using the git/git-client plugin and cloning our repos on these jobs using explicit git commands in our execute shells. Will consider downgrading plugins if it's not an easy/quick fix.

        Attachments

          Issue Links

            Activity

            Hide
            next2you Christian van der Leeden added a comment - - edited

            Same problem here. Just checked with a fresh jenkins installation, but symlink support with git is broken. The basic problem is that the git-client does a git init with JGit, which will create the directory and the .git/config file and add the

            symlinks = false

            This in turn lets the git command line client not support symlinks. So the whole point of using the git command line client instead of JGit to support symlinks is currently not working.

            As regression: It seems to be a problem of JGit 3.3
            For JGit 3.3: It is in FileRepository.java in create() method. There is a symlink check (if the OS supports symlinks) which seems to be broken. 3.2 doesn't include this check.

            My Workaround:
            Downgrading to git-client 1.6.4 (JGit 3.2) doesn't set this property. To downgrade, download it here: http://mirrors.jenkins-ci.org/plugins/git-client/1.6.4/ and copy it over the git-client.jpi in the plugins directory and restart jenkins.

            Show
            next2you Christian van der Leeden added a comment - - edited Same problem here. Just checked with a fresh jenkins installation, but symlink support with git is broken. The basic problem is that the git-client does a git init with JGit, which will create the directory and the .git/config file and add the symlinks = false This in turn lets the git command line client not support symlinks. So the whole point of using the git command line client instead of JGit to support symlinks is currently not working. As regression: It seems to be a problem of JGit 3.3 For JGit 3.3: It is in FileRepository.java in create() method. There is a symlink check (if the OS supports symlinks) which seems to be broken. 3.2 doesn't include this check. My Workaround: Downgrading to git-client 1.6.4 (JGit 3.2) doesn't set this property. To downgrade, download it here: http://mirrors.jenkins-ci.org/plugins/git-client/1.6.4/ and copy it over the git-client.jpi in the plugins directory and restart jenkins.
            Hide
            markewaite Mark Waite added a comment - - edited

            Will be fixed with the release of git-client-plugin 1.7.0. The "git init" for command line git will be done by command line git instead of using JGit. There may be slightly lower performance, but it seems reasonable to prefer the command line implementation as much as we reasonably can when the user chooses the command line implementation

            Show
            markewaite Mark Waite added a comment - - edited Will be fixed with the release of git-client-plugin 1.7.0. The "git init" for command line git will be done by command line git instead of using JGit. There may be slightly lower performance, but it seems reasonable to prefer the command line implementation as much as we reasonably can when the user chooses the command line implementation
            Hide
            markewaite Mark Waite added a comment -

            git-client-plugin 1.7.0 is available on the update center.

            Show
            markewaite Mark Waite added a comment - git-client-plugin 1.7.0 is available on the update center.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Mark Waite
            Path:
            README.md
            src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestCase.java
            http://jenkins-ci.org/commit/git-client-plugin/1ade04abc266a098bf21728016d98b053228dd28
            Log:
            Add tests for core.symlinks setting from init() and init_()

            Refer to JENKINS-22376, JENKINS-21168, and JENKINS-22391 for details.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: README.md src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestCase.java http://jenkins-ci.org/commit/git-client-plugin/1ade04abc266a098bf21728016d98b053228dd28 Log: Add tests for core.symlinks setting from init() and init_() Refer to JENKINS-22376 , JENKINS-21168 , and JENKINS-22391 for details.
            Hide
            brainshakc Christian Loock added a comment -

            Hello,

            I am having the same Issue on Ubuntu Using Git Plugin Version 1.8.1 using Command Line Git.

            In .git/config in the job workspace core.symlink is set to false, which breaks my build.

            Show
            brainshakc Christian Loock added a comment - Hello, I am having the same Issue on Ubuntu Using Git Plugin Version 1.8.1 using Command Line Git. In .git/config in the job workspace core.symlink is set to false, which breaks my build.
            Hide
            brainshakc Christian Loock added a comment -

            Updated to 2.2.1, now it works.

            Show
            brainshakc Christian Loock added a comment - Updated to 2.2.1, now it works.
            Hide
            dothebart Wilfried Goesgens added a comment - - edited

            I'm seeing this again with Jenkins 2.46,

            • Jenkins Git client plugin 2.2.1
            • Jenkins Git plugin 3.0.5
            • SCM Step 2.3
            • SCM API Plugin 2.0.3
              I've tried via old style click and go jenkins jobs, and via jenkins pipeline:

            checkout([$class: 'GitSCM',
            branches: [[name: "${GITTAG}"]],
            doGenerateSubmoduleConfigurations: false,
            extensions: [[$class: 'SubmoduleOption',
            disableSubmodules: false,
            parentCredentials: false,
            recursiveSubmodules: true,
            reference: '',
            trackingSubmodules: false]],
            submoduleCfg: [],
            userRemoteConfigs:
            [[url: 'https://github.com/arangodb/arangodb.git']]])
            Is there eventually a way to set this option here? I didn't find it in the snippet generator?

            Show
            dothebart Wilfried Goesgens added a comment - - edited I'm seeing this again with Jenkins 2.46, Jenkins Git client plugin 2.2.1 Jenkins Git plugin 3.0.5 SCM Step 2.3 SCM API Plugin 2.0.3 I've tried via old style click and go jenkins jobs, and via jenkins pipeline: checkout([$class: 'GitSCM', branches: [ [name: "${GITTAG}"] ], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'SubmoduleOption', disableSubmodules: false, parentCredentials: false, recursiveSubmodules: true, reference: '', trackingSubmodules: false]], submoduleCfg: [], userRemoteConfigs: [ [url: 'https://github.com/arangodb/arangodb.git'] ]]) Is there eventually a way to set this option here? I didn't find it in the snippet generator?
            Hide
            markewaite Mark Waite added a comment -

            Wilfried Goesgens, there is no option to alter the setting of core.symlinks from the git client plugin or the git plugin as far as I know.

            Show
            markewaite Mark Waite added a comment - Wilfried Goesgens , there is no option to alter the setting of core.symlinks from the git client plugin or the git plugin as far as I know.

              People

              • Assignee:
                markewaite Mark Waite
                Reporter:
                mjanulewicz Matt Janulewicz
              • Votes:
                2 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: