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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • git-plugin
    • None

      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.

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

              Created:
              Updated:
              Resolved: