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

Installation should initialize ~/.gitconfig if necessary

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      Platform: Macintosh, OS: All
    • Similar Issues:

      Description

      Might the git plugin, upon installation of a first run, check for the existence of the ~/.gitconfig file and if
      not there then generate it using "Hudson" as name and the
      hudson server's email address (configured elsewhere) ?

        Attachments

          Issue Links

            Activity

            Hide
            plentz Diego Plentz added a comment -
                • Issue 3874 has been marked as a duplicate of this issue. ***
            Show
            plentz Diego Plentz added a comment - Issue 3874 has been marked as a duplicate of this issue. ***
            Hide
            tacianotres Taciano Tres added a comment -

            +1.

            Show
            tacianotres Taciano Tres added a comment - +1.
            Hide
            prenaud76 Patrick Renaud added a comment -

            Any chance of having this feature included in an upcoming release?

            Show
            prenaud76 Patrick Renaud added a comment - Any chance of having this feature included in an upcoming release?
            Hide
            abayer Andrew Bayer added a comment -

            I haven't touched this one because I'm not honestly sure it's a good idea to mess around in the home directory of the user Hudson (or the slave, etc) is running as - as a rule, I don't think Hudson should be writing anything to anywhere outside of HUDSON_HOME, the slave root, or /tmp.

            Show
            abayer Andrew Bayer added a comment - I haven't touched this one because I'm not honestly sure it's a good idea to mess around in the home directory of the user Hudson (or the slave, etc) is running as - as a rule, I don't think Hudson should be writing anything to anywhere outside of HUDSON_HOME, the slave root, or /tmp.
            Hide
            mn Mykola Nikishov added a comment -

            This issue is about providing a default user's name and e-mail if they are missing. "~/.gitconfig" is the same as "$HUDSON_HOME/.gitconfig" and it's safe to generate a default hudson user's name as a constant "Hudson" and e-mail using one provided in the global configuration.

            Show
            mn Mykola Nikishov added a comment - This issue is about providing a default user's name and e-mail if they are missing. "~/.gitconfig" is the same as "$HUDSON_HOME/.gitconfig" and it's safe to generate a default hudson user's name as a constant "Hudson" and e-mail using one provided in the global configuration.
            Hide
            docwhat Christian Höltje added a comment -

            Actually, you don't have to change ~/.gitconfig at all.

            Just do:

            git config user.email "you@example.com"
            git config user.name "Your Name"

            ...from within the git repository you just cloned/created.

            Alternatively, you can set the environment variables:
            GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL, GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL

            Show
            docwhat Christian Höltje added a comment - Actually, you don't have to change ~/.gitconfig at all. Just do: git config user.email "you@example.com" git config user.name "Your Name" ...from within the git repository you just cloned/created. Alternatively, you can set the environment variables: GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL, GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL
            Hide
            abayer Andrew Bayer added a comment -

            I'm taking that approach - this'll be in the next release.

            Show
            abayer Andrew Bayer added a comment - I'm taking that approach - this'll be in the next release.
            Hide
            dogfood dogfood added a comment -

            Integrated in plugins_git-plugin #83
            [FIXED JENKINS-2754] If specified, set environment variables for user.name and user.email so that ~/.gitconfig doesn't actually have to be initialized.

            Andrew Bayer :
            Files :

            • src/test/java/hudson/plugins/git/GitSCMTest.java
            • src/main/resources/hudson/plugins/git/GitSCM/help-gitConfigName.html
            • src/main/resources/hudson/plugins/git/GitSCM/global.jelly
            • src/main/java/hudson/plugins/git/GitPublisher.java
            • src/main/resources/hudson/plugins/git/GitSCM/help-globalConfigEmail.html
            • src/main/resources/hudson/plugins/git/GitSCM/config.jelly
            • src/main/resources/hudson/plugins/git/GitSCM/help-globalConfigName.html
            • src/main/java/hudson/plugins/git/GitSCM.java
            • src/main/resources/hudson/plugins/git/GitSCM/help-gitConfigEmail.html
            Show
            dogfood dogfood added a comment - Integrated in plugins_git-plugin #83 [FIXED JENKINS-2754] If specified, set environment variables for user.name and user.email so that ~/.gitconfig doesn't actually have to be initialized. Andrew Bayer : Files : src/test/java/hudson/plugins/git/GitSCMTest.java src/main/resources/hudson/plugins/git/GitSCM/help-gitConfigName.html src/main/resources/hudson/plugins/git/GitSCM/global.jelly src/main/java/hudson/plugins/git/GitPublisher.java src/main/resources/hudson/plugins/git/GitSCM/help-globalConfigEmail.html src/main/resources/hudson/plugins/git/GitSCM/config.jelly src/main/resources/hudson/plugins/git/GitSCM/help-globalConfigName.html src/main/java/hudson/plugins/git/GitSCM.java src/main/resources/hudson/plugins/git/GitSCM/help-gitConfigEmail.html

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                dsmiley dsmiley
              • Votes:
                5 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: