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

Problem under Windows .gitconfig vs. gitconfig

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: git-plugin
    • Labels:
    • Environment:
      Jenkins ver. 2.60.1
      Git client 3.6.4
      Git for windows
    • Similar Issues:

      Description

      When the gitconfig is stored with a preceeding . i.e. .gitconfig the plugin has problems to find/read it. I have observed this with the configuration for self-signed ssl certificates, similar to the issue JENKINS-48334

      My Setup

      I have ...

      • git for Windows installed on the Jenkins Server under *D:\TOOLS\Git*
      • jenkins configured so that the git-plugin uses D:\TOOLS\Git\mingw64\bin\git.exe
      • a Bitbucket with a self-signed certificate
      • a Certificate chain ca-chain.pem can be found under D:\TOOLS\Git\mingw64\ssl\certs (contains the full CA-chain required to reconsider the certificate from stash/bitbucket as valid)
      • a .gitconfig file in the home directory of the user who runs jenkins service (let's call him 'jenkinsuser'
      • the .gitconfig file contains the following configuration

      [http]

          sslcainfo = /ssl/certs/ca-chain.pem

          sslVerify = true

      My Observations

      When I (jenkinsuser)

      {{Failed to connect to repository : Command "D:\TOOLS\Git\mingw64\bin\git.exe ls-remote -h https://bitbucket/scm/test/test.git HEAD" returned status code 128: }}
      {{stdout: }}
      stderr: fatal: unable to access 'https://bitbucket/scm/test/test.git ': error setting certificate verify locations: CAfile: D:/TOOLS/Git/mingw64/libexec/ssl/certs/ca-bundle.crt CApath: none

      When I rename the file from .gitconfig to gitconfig Jenkins has no problems.

      The same can be observed if you rename the D:\TOOLS\Git\mingw64\etc\gitconfig to .gitconfig

      Again when calling git form command line the name .gitconfig or gitconfig does not make any difference, both work fine.

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment - - edited

          JENKINS-47832 reported a behavioral difference between bin\git.exe and mingw64\git.exe. The mingw64 variant of the git executables is not tested with the Jenkins git plugin.

          Does it behave any better if you use D:\TOOLS\Git\bin\git.exe as the git executable rather than the mingw64 variant?

          Show
          markewaite Mark Waite added a comment - - edited JENKINS-47832 reported a behavioral difference between bin\git.exe and mingw64\git.exe . The mingw64 variant of the git executables is not tested with the Jenkins git plugin. Does it behave any better if you use D:\TOOLS\Git\bin\git.exe as the git executable rather than the mingw64 variant?
          Hide
          papanito Adrian Wyssmann added a comment -

          I have the same problem when I configure the plugin to use ```D:\TOOLS\Git\bin\git.exe```

          Show
          papanito Adrian Wyssmann added a comment - I have the same problem when I configure the plugin to use ```D:\TOOLS\Git\bin\git.exe```
          Hide
          markewaite Mark Waite added a comment -

          According to the git-config documentation, the system-wide git configuration file is named $(prefix)/etc/gitconfig . Placing a file named .gitconfig in the system directory should have no effect, since that's not the name which command line git will read.

          I don't know why there would be a difference in that behavior. I recommend against using self-signed certificates,, especially with commercially purchased source control systems.

          Show
          markewaite Mark Waite added a comment - According to the git-config documentation , the system-wide git configuration file is named $(prefix)/etc/gitconfig . Placing a file named .gitconfig in the system directory should have no effect, since that's not the name which command line git will read. I don't know why there would be a difference in that behavior. I recommend against using self-signed certificates,, especially with commercially purchased source control systems.
          Hide
          papanito Adrian Wyssmann added a comment -

          The self-signe certificate is just something that makes the bug visible, but it will appear to any settings in your gitconfig.

          Show
          papanito Adrian Wyssmann added a comment - The self-signe certificate is just something that makes the bug visible, but it will appear to any settings in your gitconfig.

            People

            • Assignee:
              Unassigned
              Reporter:
              papanito Adrian Wyssmann
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: