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

Git plugin will not build a project with an empty repo

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • git-plugin
    • None
    • Jenkins 2.75
      Git Plugin 3.5.1

      The SCM change tracker does not handle empty repos in the expected way. It finds finds changes, and then starts a build, which fails, as there is no branch to pull and then build.

       

      Expected Behavior: No changes detected on a bare repo, and no build started.

       

      Log of SCM run (company name redacted)

      Started on Sep 19, 2017 8:26:00 AM
      Using strategy: Default
      > git ls-remote -h git@bitbucket.org:***/guide.backendbucket.sueffa.git # timeout=10
      Unexpected ls-remote output line ''
      [poll] Couldn't get remote head revision
      Done. Took 3.9 sec
      Changes found

       

      Log of Build (company name redacted):
      Started by an SCM change
      Building in workspace /mnt/storage/jenkins/workspace/backendbucket.sueffa sync (integration)
      > git rev-parse --is-inside-work-tree # timeout=10
      Fetching changes from the remote Git repository
      > git config remote.origin.url git@bitbucket.org:***/guide.backendbucket.sueffa.git # timeout=10
      Fetching upstream changes from git@bitbucket.org:***/guide.backendbucket.sueffa.git
      > git --version # timeout=10
      > git fetch --tags --progress git@bitbucket.org:**/guide.backendbucket.sueffa.git +refs/heads/:refs/remotes/origin/*
      > git rev-parse refs/remotes/origin/integration^{commit} # timeout=10
      > git rev-parse refs/remotes/origin/origin/integration^{commit} # timeout=10
      > git rev-parse origin/integration^{commit} # timeout=10
      ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
      Notified JIRA that a build has completed.
      Finished: FAILURE

          [JENKINS-46954] Git plugin will not build a project with an empty repo

          Mark Waite added a comment -

          The git plugin is not designed or intended to perform any useful operations on a bare repository in a workspace.

          Could you describe further what your intended use case is?

          Mark Waite added a comment - The git plugin is not designed or intended to perform any useful operations on a bare repository in a workspace. Could you describe further what your intended use case is?

          It was not an intended usecase, but the jenkins job was created at the time the repo was created in order to have automatic builds ready when the repo is filled by a customer.

          Carsten Kirschner added a comment - It was not an intended usecase, but the jenkins job was created at the time the repo was created in order to have automatic builds ready when the repo is filled by a customer.

          Mark Waite added a comment -

          Ah, I think I may have misinterpreted your use of the word "bare".  In git, "bare" has a very specific meaning, since it is a representation of a repository which has no working copy, and cannot have a working copy in the repository tree.

          I believe you are saying that the git plugin does not handle a repository which contains no commits.  I'd call that an "empty" repository rather than a bare repository, to avoid confusion between the very specific git term "bare" and the more general purpose term "empty".

          Can you confirm that your repository contains no commits, but has a working copy?

          Yes, it is intentional that the git plugin assumes it has work to do when it is launched, and it considers it an error if no work is then detected to be performed.

          Mark Waite added a comment - Ah, I think I may have misinterpreted your use of the word "bare".  In git, "bare" has a very specific meaning, since it is a representation of a repository which has no working copy, and cannot have a working copy in the repository tree. I believe you are saying that the git plugin does not handle a repository which contains no commits.  I'd call that an "empty" repository rather than a bare repository, to avoid confusion between the very specific git term "bare" and the more general purpose term "empty". Can you confirm that your repository contains no commits, but has a working copy? Yes, it is intentional that the git plugin assumes it has work to do when it is launched, and it considers it an error if no work is then detected to be performed.

          Hello Mark Waite,

          yes, i mean an empty repo. I was not aware that bare has the other meaning.

          Carsten Kirschner added a comment - Hello Mark Waite, yes, i mean an empty repo. I was not aware that bare has the other meaning.

            Unassigned Unassigned
            ckirschner Carsten Kirschner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: