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

Can't specify remote repository's branch to build

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • git-plugin
    • None
    • Windows Server 2008

      I want to specify remote repository's branch when I set multi remote repository in a git repository like attachment image.
      But Jenkins Git plugin always checkout latest commit when it set multi remote repository.

          [JENKINS-22144] Can't specify remote repository's branch to build

          Mark Waite added a comment -

          Alexander Link just added some improved help for the branch selection field. That may help you see how you need to specify the branch name in order to achieve the result you want.

          Refer to https://github.com/jenkinsci/git-plugin/commit/48583bf82e8f563cd5368e1567b11e4190959eae for the details. I believe the key change needed for that improvement is included in git-client-plugin 1.6.4, and is not available in git-client-plugin versions prior to 1.6.4.

          The behavior you observe (aaa/master is not treated any differently than origin/master) is an expected behavior that we didn't want to change, lest it break compatibility with existing user jobs. Alexander added the ability to provide a more precise specification of the branch name, while still retaining the older behavior for simpler branch names.

          Can you review his comments and try them with git-client-plugin 1.6.4 to see if they resolve your issue?

          Mark Waite added a comment - Alexander Link just added some improved help for the branch selection field. That may help you see how you need to specify the branch name in order to achieve the result you want. Refer to https://github.com/jenkinsci/git-plugin/commit/48583bf82e8f563cd5368e1567b11e4190959eae for the details. I believe the key change needed for that improvement is included in git-client-plugin 1.6.4, and is not available in git-client-plugin versions prior to 1.6.4. The behavior you observe (aaa/master is not treated any differently than origin/master) is an expected behavior that we didn't want to change, lest it break compatibility with existing user jobs. Alexander added the ability to provide a more precise specification of the branch name, while still retaining the older behavior for simpler branch names. Can you review his comments and try them with git-client-plugin 1.6.4 to see if they resolve your issue?

          kompiro added a comment -

          Thanks your comment.

          I added "remotes/" to "Branch Specifier" like "remotes/aaa/master", Git Plugin 2.0.4 couldn't verify the format.
          I updated Git Plugin to 2.0.5-SNAPSHOT and git-client-plugin 1.6.5-SNAPSHOT,
          the plugin could verify the format. But it couldn't checkout the specified remote branch.

          Does Jenkins Git plugin team work in progress about this feature?

          kompiro added a comment - Thanks your comment. I added "remotes/" to "Branch Specifier" like "remotes/aaa/master", Git Plugin 2.0.4 couldn't verify the format. I updated Git Plugin to 2.0.5-SNAPSHOT and git-client-plugin 1.6.5-SNAPSHOT, the plugin could verify the format. But it couldn't checkout the specified remote branch. Does Jenkins Git plugin team work in progress about this feature?

          Mark Waite added a comment -

          kompiro yes, there is a pending commit to complete the work. I had missed there another commit was needed, but the author of the commit detected the gap and has submitted a proposed change.

          Mark Waite added a comment - kompiro yes, there is a pending commit to complete the work. I had missed there another commit was needed, but the author of the commit detected the gap and has submitted a proposed change.

          Mark Waite added a comment -

          kompiro yes, there is a pending commit to complete the work. I had missed there another commit was needed, but the author of the commit detected the gap and has submitted a proposed change.

          Mark Waite added a comment - kompiro yes, there is a pending commit to complete the work. I had missed there another commit was needed, but the author of the commit detected the gap and has submitted a proposed change.

          Mark Waite added a comment -

          The change is now available as part of git-client-plugin 1.7.0 and git-plugin 2.1.0. Could you try them now to see if they better meet your needs? The help is now available for the "Branch Specifier" field, and hopefully that will clarify the forms which are allowed and how they are interpreted.

          Mark Waite added a comment - The change is now available as part of git-client-plugin 1.7.0 and git-plugin 2.1.0. Could you try them now to see if they better meet your needs? The help is now available for the "Branch Specifier" field, and hopefully that will clarify the forms which are allowed and how they are interpreted.

          Mark Waite added a comment -

          I've attempted an experiment or two and was not successful trying to checkout a branch from a second repository with the syntax "refs/remotes/somename/somebranch". More investigation is needed.

          Mark Waite added a comment - I've attempted an experiment or two and was not successful trying to checkout a branch from a second repository with the syntax "refs/remotes/somename/somebranch". More investigation is needed.

            Unassigned Unassigned
            kompiro kompiro
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: