• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • git-plugin
    • None

      When a local branch is checked out with name matching a remote branch, and the remote branch is rewritten, endless builds are triggered. This happens because the plugin finds multiple matching revisions, one in the local and one in the remote branch:

      Multiple candidate revisions
      Scheduling another build to catch up with <build name>

      This can be solved by using the fully qualified remote branch name as specifier, i.e. "remotes/origin/branchname". But this is not possible in my case since the branch name is generated by the multibranch plugin.

      A simple fix might be to delete the automatic local branch before trying to match branch names; the local branch is anyway deleted a bit later, before it is recreated:

      Multiple candidate revisions
      Scheduling another build to catch up with <build name>
      Checking out Revision <revision> (<local branch name>)
      > git config core.sparsecheckout # timeout=10
      > git checkout -f <revision>
      > git branch -a -v --no-abbrev # timeout=10
      > git branch -D <local branch name> # timeout=10
      > git checkout -b <local branch name> <revision>

      ...or, alternatively, exclude the automatic local branch explicitly from the branch name matching.

       

          [JENKINS-54102] Endless builds with local branch checked out

          Joachim Haga created issue -
          Joachim Haga made changes -
          Description Original: When a local branch is checked out with name matching a remote branch, and the remote branch is rewritten, endless builds are triggered. This happens because the plugin finds multiple matching revisions, one in the local and one in the remote branch:
          Multiple candidate revisions
          Scheduling another build to catch up with <build name>
          This can be solved by using the fully qualified remote branch name as specifier, i.e. "remotes/origin/branchname". But this is not possible in my case since the branch name is generated by the multibranch plugin.

          A simple fix might be to delete the automatic local branch before trying to match branch names; the local branch is anyway deleted a bit later, before it is recreated:
          Multiple candidate revisions
          Scheduling another build to catch up with <build name>
          Checking out Revision <revision> (srp/master)
           > git config core.sparsecheckout # timeout=10
           > git checkout -f <revision>
           > git branch -a -v --no-abbrev # timeout=10
           > git branch -D <local branch name> # timeout=10
           > git checkout -b <local branch name> <revision>
          ...or, alternatively, exclude the automatic local branch explicitly from the branch name matching.
          New: When a local branch is checked out with name matching a remote branch, and the remote branch is rewritten, endless builds are triggered. This happens because the plugin finds multiple matching revisions, one in the local and one in the remote branch:
           {{}}
          {code:java}
          Multiple candidate revisions
          Scheduling another build to catch up with <build name>{code}
          {{}}

           


           This can be solved by using the fully qualified remote branch name as specifier, i.e. "remotes/origin/branchname". But this is not possible in my case since the branch name is generated by the multibranch plugin.

          A simple fix might be to delete the automatic local branch before trying to match branch names; the local branch is anyway deleted a bit later, before it is recreated:
          {code:java}
          Multiple candidate revisions
          Scheduling another build to catch up with <build name>
          Checking out Revision <revision> (<local branch name>)
          > git config core.sparsecheckout # timeout=10
          > git checkout -f <revision>
          > git branch -a -v --no-abbrev # timeout=10
          > git branch -D <local branch name> # timeout=10
          > git checkout -b <local branch name> <revision>{code}
          ...or, alternatively, exclude the automatic local branch explicitly from the branch name matching.

           
          Joachim Haga made changes -
          Description Original: When a local branch is checked out with name matching a remote branch, and the remote branch is rewritten, endless builds are triggered. This happens because the plugin finds multiple matching revisions, one in the local and one in the remote branch:
           {{}}
          {code:java}
          Multiple candidate revisions
          Scheduling another build to catch up with <build name>{code}
          {{}}

           


           This can be solved by using the fully qualified remote branch name as specifier, i.e. "remotes/origin/branchname". But this is not possible in my case since the branch name is generated by the multibranch plugin.

          A simple fix might be to delete the automatic local branch before trying to match branch names; the local branch is anyway deleted a bit later, before it is recreated:
          {code:java}
          Multiple candidate revisions
          Scheduling another build to catch up with <build name>
          Checking out Revision <revision> (<local branch name>)
          > git config core.sparsecheckout # timeout=10
          > git checkout -f <revision>
          > git branch -a -v --no-abbrev # timeout=10
          > git branch -D <local branch name> # timeout=10
          > git checkout -b <local branch name> <revision>{code}
          ...or, alternatively, exclude the automatic local branch explicitly from the branch name matching.

           
          New: When a local branch is checked out with name matching a remote branch, and the remote branch is rewritten, endless builds are triggered. This happens because the plugin finds multiple matching revisions, one in the local and one in the remote branch:
           {code:html}
          Multiple candidate revisions
          Scheduling another build to catch up with <build name>{code}

           This can be solved by using the fully qualified remote branch name as specifier, i.e. "remotes/origin/branchname". But this is not possible in my case since the branch name is generated by the multibranch plugin.

          A simple fix might be to delete the automatic local branch before trying to match branch names; the local branch is anyway deleted a bit later, before it is recreated:
          {code:html}
          Multiple candidate revisions
          Scheduling another build to catch up with <build name>
          Checking out Revision <revision> (<local branch name>)
          > git config core.sparsecheckout # timeout=10
          > git checkout -f <revision>
          > git branch -a -v --no-abbrev # timeout=10
          > git branch -D <local branch name> # timeout=10
          > git checkout -b <local branch name> <revision>{code}
          ...or, alternatively, exclude the automatic local branch explicitly from the branch name matching.

           
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]

            Unassigned Unassigned
            jobh Joachim Haga
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: