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

Problem under Windows .gitconfig vs. gitconfig

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • Jenkins ver. 2.60.1
      Git client 3.6.4
      Git for windows

      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.

          [JENKINS-48542] Problem under Windows .gitconfig vs. gitconfig

          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?

          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?

          papanito added a comment -

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

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

          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.

          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.

          papanito 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.

          papanito 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.

            Unassigned Unassigned
            papanito papanito
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: