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

rev-parse can display a warning message and break current build revision

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Trivial
    • Resolution: Fixed
    • Component/s: git-plugin
    • Labels:
      None
    • Similar Issues:

      Description

      We had a problem where a job would not pick up changes from git. It turned out that:

      hudson.plugins.git.GitAPI#revParse(String revName)

      just takes the first line of output from the rev-parse command into account.

      Our problem was that someone had created a tag with the same name as the master branch. So we had 'origin/master' as the name of a tag and as the remote branch. This causes rev-parse to output:

      $ git rev-parse origin/master
      warning: refname 'origin/master' is ambiguous.
      1a7b6f67b971f01f78c685f3d0917ea623fb5122

      which stopped the plugin from figuring out what new revision should be. The problem was that this piece of information was not output in the build logs so was a bit tricky to track down.

      I'm guessing that a simple check for this output and an appropriate exception could be added to GitAPI to aid in tracking this kind of problem down.

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment -

          Wrote an automated test to verify that git client plugin 1.0.5 does not have this problem. A pull request for the automated test has been submitted to the git-client-plugin repository.

          Show
          markewaite Mark Waite added a comment - Wrote an automated test to verify that git client plugin 1.0.5 does not have this problem. A pull request for the automated test has been submitted to the git-client-plugin repository.
          Hide
          markewaite Mark Waite added a comment -

          Already fixed in the git-client-plugin 1.0.5 release, and possibly fixed in earlier releases as well.

          Show
          markewaite Mark Waite added a comment - Already fixed in the git-client-plugin 1.0.5 release, and possibly fixed in earlier releases as well.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            lorenzhawkes Lorenz Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: