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

Git rev-parse branch failed because of specified colors in ~/.gitconfig

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • git-plugin
    • Linux (Ubuntu 14.04 & SUSE Linux Enterprise Server 10 SP3), Jenkins 1.566, GIT plugin 2.2.1

      The error shows as below after set the Branch name from Additional Behaviours -> Check out to specific local branch.

       > git config core.sparsecheckout
       > git checkout -f 0bd22591afff0f67e84f9ce97365e1772351b3ce
       > git branch -a
       > git rev-parse (detached from 0bd2259)^{commit}
      FATAL: Could not checkout HEAD with start point 0bd22591afff0f67e84f9ce97365e1772351b3ce
      hudson.plugins.git.GitException: Could not checkout HEAD with start point 0bd22591afff0f67e84f9ce97365e1772351b3ce
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$8.execute(CliGitAPIImpl.java:1497)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:896)
      	at hudson.model.AbstractProject.checkout(AbstractProject.java:1252)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
      	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:513)
      	at hudson.model.Run.execute(Run.java:1710)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:231)
      Caused by: hudson.plugins.git.GitException: Command "git rev-parse (detached from 0bd2259)^{commit}" returned status code 128:
      stdout: (detached from 0bd2259)^{commit}
      
      stderr: fatal: ambiguous argument '(detached from 0bd2259)^{commit}': unknown revision or path not in the working tree.
      Use '--' to separate paths from revisions, like this:
      'git <command> [<revision>...] -- [<file>...]'
      

      Full Jenkins Console Output has been attached (Jenkins-Git-failed-full-log.txt).

      After analyzed, the error is because of the specified colors set in the ~/.gitconfig.
      The color settings as blow, details can be found from my github:

      [color]
        ui = true
        log = always
        status = always
        add = always
        push = always
        pull = always
        diff = always
        branch = always
        interactive = auto
      [color "branch"]
        current = green bold
        local = yellow
        remote = red
      [color "status"]
        added = yellow
        changed = red bold
        untracked = magenta normal dim
      [color "diff"]
        meta = blue bold
        frag = magenta
        old = red bold
        new = green bold
        whitespace = red reverse
      

      Here the Jenkins job setting:

      Can git plugin "ignore" the settings automatically (the settings like colors). I've Created a question in stackoverflow

          [JENKINS-23379] Git rev-parse branch failed because of specified colors in ~/.gitconfig

          Marslo Jiao created issue -
          Marslo Jiao made changes -
          Description Original: The error shows as below because of the specified colors set in the [~/.gitconfig|https://github.com/Marslo/LinuxStuff/blob/master/Configs/HOME/Git/.gitconfig]:
          {noformat}
           > git config core.sparsecheckout
           > git checkout -f 0bd22591afff0f67e84f9ce97365e1772351b3ce
           > git branch -a
           > git rev-parse (detached from 0bd2259)^{commit}
          FATAL: Could not checkout HEAD with start point 0bd22591afff0f67e84f9ce97365e1772351b3ce
          hudson.plugins.git.GitException: Could not checkout HEAD with start point 0bd22591afff0f67e84f9ce97365e1772351b3ce
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$8.execute(CliGitAPIImpl.java:1497)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:896)
          at hudson.model.AbstractProject.checkout(AbstractProject.java:1252)
          at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
          at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:513)
          at hudson.model.Run.execute(Run.java:1710)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:231)
          Caused by: hudson.plugins.git.GitException: Command "git rev-parse (detached from 0bd2259)^{commit}" returned status code 128:
          stdout: (detached from 0bd2259)^{commit}

          stderr: fatal: ambiguous argument '(detached from 0bd2259)^{commit}': unknown revision or path not in the working tree.
          Use '--' to separate paths from revisions, like this:
          'git <command> [<revision>...] -- [<file>...]'
          {noformat}

          The full log has been attached.

          The color settings as blow, details can be found from [my github|https://github.com/Marslo/LinuxStuff/blob/master/Configs/HOME/Git/.gitconfig#L23]:
          {noforamt}
          [color]
            ui = true
            log = always
            status = always
            add = always
            push = always
            pull = always
            diff = always
            branch = always
            interactive = auto
          [color "branch"]
            current = green bold
            local = yellow
            remote = red
          [color "status"]
            added = yellow
            changed = red bold
            untracked = magenta normal dim
          [color "diff"]
            meta = blue bold
            frag = magenta
            old = red bold
            new = green bold
            whitespace = red reverse
          {noformat}

          Can git plugin "ignore" the settings automatically (the settings like colors). I've [Created a question in stackoverflow|http://stackoverflow.com/questions/24118259/how-can-jenkins-ignore-the-color-settings-in-gitconfig-by-using-git-plugin]
          New: The error shows as below because of the specified colors set in the [~/.gitconfig|https://github.com/Marslo/LinuxStuff/blob/master/Configs/HOME/Git/.gitconfig]:
          {noformat}
           > git config core.sparsecheckout
           > git checkout -f 0bd22591afff0f67e84f9ce97365e1772351b3ce
           > git branch -a
           > git rev-parse (detached from 0bd2259)^{commit}
          FATAL: Could not checkout HEAD with start point 0bd22591afff0f67e84f9ce97365e1772351b3ce
          hudson.plugins.git.GitException: Could not checkout HEAD with start point 0bd22591afff0f67e84f9ce97365e1772351b3ce
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$8.execute(CliGitAPIImpl.java:1497)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:896)
          at hudson.model.AbstractProject.checkout(AbstractProject.java:1252)
          at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
          at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:513)
          at hudson.model.Run.execute(Run.java:1710)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:231)
          Caused by: hudson.plugins.git.GitException: Command "git rev-parse (detached from 0bd2259)^{commit}" returned status code 128:
          stdout: (detached from 0bd2259)^{commit}

          stderr: fatal: ambiguous argument '(detached from 0bd2259)^{commit}': unknown revision or path not in the working tree.
          Use '--' to separate paths from revisions, like this:
          'git <command> [<revision>...] -- [<file>...]'
          {noformat}

          The full log has been attached.

          The color settings as blow, details can be found from [my github|https://github.com/Marslo/LinuxStuff/blob/master/Configs/HOME/Git/.gitconfig#L23]:
          {noformat}
          [color]
            ui = true
            log = always
            status = always
            add = always
            push = always
            pull = always
            diff = always
            branch = always
            interactive = auto
          [color "branch"]
            current = green bold
            local = yellow
            remote = red
          [color "status"]
            added = yellow
            changed = red bold
            untracked = magenta normal dim
          [color "diff"]
            meta = blue bold
            frag = magenta
            old = red bold
            new = green bold
            whitespace = red reverse
          {noformat}

          Can git plugin "ignore" the settings automatically (the settings like colors). I've [Created a question in stackoverflow|http://stackoverflow.com/questions/24118259/how-can-jenkins-ignore-the-color-settings-in-gitconfig-by-using-git-plugin]
          Marslo Jiao made changes -
          Attachment New: git-plugin.png [ 26047 ]
          Marslo Jiao made changes -
          Description Original: The error shows as below because of the specified colors set in the [~/.gitconfig|https://github.com/Marslo/LinuxStuff/blob/master/Configs/HOME/Git/.gitconfig]:
          {noformat}
           > git config core.sparsecheckout
           > git checkout -f 0bd22591afff0f67e84f9ce97365e1772351b3ce
           > git branch -a
           > git rev-parse (detached from 0bd2259)^{commit}
          FATAL: Could not checkout HEAD with start point 0bd22591afff0f67e84f9ce97365e1772351b3ce
          hudson.plugins.git.GitException: Could not checkout HEAD with start point 0bd22591afff0f67e84f9ce97365e1772351b3ce
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$8.execute(CliGitAPIImpl.java:1497)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:896)
          at hudson.model.AbstractProject.checkout(AbstractProject.java:1252)
          at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
          at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:513)
          at hudson.model.Run.execute(Run.java:1710)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:231)
          Caused by: hudson.plugins.git.GitException: Command "git rev-parse (detached from 0bd2259)^{commit}" returned status code 128:
          stdout: (detached from 0bd2259)^{commit}

          stderr: fatal: ambiguous argument '(detached from 0bd2259)^{commit}': unknown revision or path not in the working tree.
          Use '--' to separate paths from revisions, like this:
          'git <command> [<revision>...] -- [<file>...]'
          {noformat}

          The full log has been attached.

          The color settings as blow, details can be found from [my github|https://github.com/Marslo/LinuxStuff/blob/master/Configs/HOME/Git/.gitconfig#L23]:
          {noformat}
          [color]
            ui = true
            log = always
            status = always
            add = always
            push = always
            pull = always
            diff = always
            branch = always
            interactive = auto
          [color "branch"]
            current = green bold
            local = yellow
            remote = red
          [color "status"]
            added = yellow
            changed = red bold
            untracked = magenta normal dim
          [color "diff"]
            meta = blue bold
            frag = magenta
            old = red bold
            new = green bold
            whitespace = red reverse
          {noformat}

          Can git plugin "ignore" the settings automatically (the settings like colors). I've [Created a question in stackoverflow|http://stackoverflow.com/questions/24118259/how-can-jenkins-ignore-the-color-settings-in-gitconfig-by-using-git-plugin]
          New: The error shows as below because of the **specified colors** set in the [~/.gitconfig|https://github.com/Marslo/LinuxStuff/blob/master/Configs/HOME/Git/.gitconfig]:
          {noformat}
           > git config core.sparsecheckout
           > git checkout -f 0bd22591afff0f67e84f9ce97365e1772351b3ce
           > git branch -a
           > git rev-parse (detached from 0bd2259)^{commit}
          FATAL: Could not checkout HEAD with start point 0bd22591afff0f67e84f9ce97365e1772351b3ce
          hudson.plugins.git.GitException: Could not checkout HEAD with start point 0bd22591afff0f67e84f9ce97365e1772351b3ce
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$8.execute(CliGitAPIImpl.java:1497)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:896)
          at hudson.model.AbstractProject.checkout(AbstractProject.java:1252)
          at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
          at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:513)
          at hudson.model.Run.execute(Run.java:1710)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:231)
          Caused by: hudson.plugins.git.GitException: Command "git rev-parse (detached from 0bd2259)^{commit}" returned status code 128:
          stdout: (detached from 0bd2259)^{commit}

          stderr: fatal: ambiguous argument '(detached from 0bd2259)^{commit}': unknown revision or path not in the working tree.
          Use '--' to separate paths from revisions, like this:
          'git <command> [<revision>...] -- [<file>...]'
          {noformat}

          The full log has been attached.

          The color settings as blow, details can be found from [my github|https://github.com/Marslo/LinuxStuff/blob/master/Configs/HOME/Git/.gitconfig#L23]:
          {noformat}
          [color]
            ui = true
            log = always
            status = always
            add = always
            push = always
            pull = always
            diff = always
            branch = always
            interactive = auto
          [color "branch"]
            current = green bold
            local = yellow
            remote = red
          [color "status"]
            added = yellow
            changed = red bold
            untracked = magenta normal dim
          [color "diff"]
            meta = blue bold
            frag = magenta
            old = red bold
            new = green bold
            whitespace = red reverse
          {noformat}

          The Jenkins job setting as below:
          !git-plugin.png!

          Can git plugin "ignore" the settings automatically (the settings like colors). I've [Created a question in stackoverflow|http://stackoverflow.com/questions/24118259/how-can-jenkins-ignore-the-color-settings-in-gitconfig-by-using-git-plugin]
          Marslo Jiao made changes -
          Description Original: The error shows as below because of the **specified colors** set in the [~/.gitconfig|https://github.com/Marslo/LinuxStuff/blob/master/Configs/HOME/Git/.gitconfig]:
          {noformat}
           > git config core.sparsecheckout
           > git checkout -f 0bd22591afff0f67e84f9ce97365e1772351b3ce
           > git branch -a
           > git rev-parse (detached from 0bd2259)^{commit}
          FATAL: Could not checkout HEAD with start point 0bd22591afff0f67e84f9ce97365e1772351b3ce
          hudson.plugins.git.GitException: Could not checkout HEAD with start point 0bd22591afff0f67e84f9ce97365e1772351b3ce
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$8.execute(CliGitAPIImpl.java:1497)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:896)
          at hudson.model.AbstractProject.checkout(AbstractProject.java:1252)
          at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
          at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:513)
          at hudson.model.Run.execute(Run.java:1710)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:231)
          Caused by: hudson.plugins.git.GitException: Command "git rev-parse (detached from 0bd2259)^{commit}" returned status code 128:
          stdout: (detached from 0bd2259)^{commit}

          stderr: fatal: ambiguous argument '(detached from 0bd2259)^{commit}': unknown revision or path not in the working tree.
          Use '--' to separate paths from revisions, like this:
          'git <command> [<revision>...] -- [<file>...]'
          {noformat}

          The full log has been attached.

          The color settings as blow, details can be found from [my github|https://github.com/Marslo/LinuxStuff/blob/master/Configs/HOME/Git/.gitconfig#L23]:
          {noformat}
          [color]
            ui = true
            log = always
            status = always
            add = always
            push = always
            pull = always
            diff = always
            branch = always
            interactive = auto
          [color "branch"]
            current = green bold
            local = yellow
            remote = red
          [color "status"]
            added = yellow
            changed = red bold
            untracked = magenta normal dim
          [color "diff"]
            meta = blue bold
            frag = magenta
            old = red bold
            new = green bold
            whitespace = red reverse
          {noformat}

          The Jenkins job setting as below:
          !git-plugin.png!

          Can git plugin "ignore" the settings automatically (the settings like colors). I've [Created a question in stackoverflow|http://stackoverflow.com/questions/24118259/how-can-jenkins-ignore-the-color-settings-in-gitconfig-by-using-git-plugin]
          New: The error shows as below after set the *Branch name* from *Additional Behaviours* -> *Check out to specific local branch*.
          {noformat}
           > git config core.sparsecheckout
           > git checkout -f 0bd22591afff0f67e84f9ce97365e1772351b3ce
           > git branch -a
           > git rev-parse (detached from 0bd2259)^{commit}
          FATAL: Could not checkout HEAD with start point 0bd22591afff0f67e84f9ce97365e1772351b3ce
          hudson.plugins.git.GitException: Could not checkout HEAD with start point 0bd22591afff0f67e84f9ce97365e1772351b3ce
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$8.execute(CliGitAPIImpl.java:1497)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:896)
          at hudson.model.AbstractProject.checkout(AbstractProject.java:1252)
          at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
          at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:513)
          at hudson.model.Run.execute(Run.java:1710)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:231)
          Caused by: hudson.plugins.git.GitException: Command "git rev-parse (detached from 0bd2259)^{commit}" returned status code 128:
          stdout: (detached from 0bd2259)^{commit}

          stderr: fatal: ambiguous argument '(detached from 0bd2259)^{commit}': unknown revision or path not in the working tree.
          Use '--' to separate paths from revisions, like this:
          'git <command> [<revision>...] -- [<file>...]'
          {noformat}

          Full Jenkins Console Output has been attached (Jenkins-Git-failed-full-log.txt).

          After analyzed, the error is because of the *specified colors* set in the ~/.gitconfig.
          The color settings as blow, details can be found from [my github|https://github.com/Marslo/LinuxStuff/blob/master/Configs/HOME/Git/.gitconfig#L23]:
          {noformat}
          [color]
            ui = true
            log = always
            status = always
            add = always
            push = always
            pull = always
            diff = always
            branch = always
            interactive = auto
          [color "branch"]
            current = green bold
            local = yellow
            remote = red
          [color "status"]
            added = yellow
            changed = red bold
            untracked = magenta normal dim
          [color "diff"]
            meta = blue bold
            frag = magenta
            old = red bold
            new = green bold
            whitespace = red reverse
          {noformat}

          Here the Jenkins job setting:
          !git-plugin.png!

          Can git plugin "ignore" the settings automatically (the settings like colors). I've [Created a question in stackoverflow|http://stackoverflow.com/questions/24118259/how-can-jenkins-ignore-the-color-settings-in-gitconfig-by-using-git-plugin]
          Mark Waite made changes -
          Resolution New: Won't Fix [ 2 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Mark Waite made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 155946 ] New: JNJira + In-Review [ 207772 ]

            ndeloof Nicolas De Loof
            marslo Marslo Jiao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: