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

git plugin doesn't support branch name contains slash ("/")

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When a branch contains slash , if we try to specify such a branch in "Branch Name" field, it will not be able to fetch such branches. If we leave branch name as **, the job can fetch branch name containing slash without problem.

      I am not a Java person, but this method looks suspicious in Branch.java, just trying to help debug

      private static String strip(String name)

      { return name.substring(name.indexOf('/', 5) + 1); }

        Attachments

          Issue Links

            Activity

            Show
            daspilker Daniel Spilker added a comment - The fix broke the ability to checkout tags. See https://github.com/jenkinsci/git-plugin/commit/a67bbc0062fa4dd4d27b8113f3a27840b53dded9#commitcomment-5140751
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Nicolas De Loof
            Path:
            src/main/java/hudson/plugins/git/GitSCM.java
            src/test/java/hudson/plugins/git/GitSCMTest.java
            http://jenkins-ci.org/commit/git-plugin/c94ac36ff6f410ce8b7f5859b0ff9b0468a5681b
            Log:
            Revert "Merge pull request #187 from jenkinsci/JENKINS-14026"

            This reverts commit a67bbc0062fa4dd4d27b8113f3a27840b53dded9, reversing
            changes made to b75d1e21dc75c8143f99baea0342169123a409c8.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De Loof Path: src/main/java/hudson/plugins/git/GitSCM.java src/test/java/hudson/plugins/git/GitSCMTest.java http://jenkins-ci.org/commit/git-plugin/c94ac36ff6f410ce8b7f5859b0ff9b0468a5681b Log: Revert "Merge pull request #187 from jenkinsci/ JENKINS-14026 " This reverts commit a67bbc0062fa4dd4d27b8113f3a27840b53dded9, reversing changes made to b75d1e21dc75c8143f99baea0342169123a409c8.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Vincent Latombe
            Path:
            src/main/java/hudson/plugins/git/util/DefaultBuildChooser.java
            http://jenkins-ci.org/commit/git-plugin/ea5cad7e2759d0c9f5ed723fe590f982b0bb818d
            Log:
            JENKINS-14026 DefaultBuildChooser should handle smartly branches with /

            When encountering a single branch containing a '/', it is either a qualified branch or a branch containing a '/'
            In the first case, the branch should start with the name of a declared remote
            Otherwise, we fall back to unqualified behaviour, and we try to match the branch name as if it was */BRANCH

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vincent Latombe Path: src/main/java/hudson/plugins/git/util/DefaultBuildChooser.java http://jenkins-ci.org/commit/git-plugin/ea5cad7e2759d0c9f5ed723fe590f982b0bb818d Log: JENKINS-14026 DefaultBuildChooser should handle smartly branches with / When encountering a single branch containing a '/', it is either a qualified branch or a branch containing a '/' In the first case, the branch should start with the name of a declared remote Otherwise, we fall back to unqualified behaviour, and we try to match the branch name as if it was */BRANCH
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Nicolas De loof
            Path:
            src/main/java/hudson/plugins/git/util/DefaultBuildChooser.java
            http://jenkins-ci.org/commit/git-plugin/b22146d14997edaaf9bd95a054c65b623606d379
            Log:
            Merge pull request #195 from Vlatombe/JENKINS-14026

            JENKINS-14026 DefaultBuildChooser should handle smartly branches with /

            Compare: https://github.com/jenkinsci/git-plugin/compare/dcae49362fc1...b22146d14997

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De loof Path: src/main/java/hudson/plugins/git/util/DefaultBuildChooser.java http://jenkins-ci.org/commit/git-plugin/b22146d14997edaaf9bd95a054c65b623606d379 Log: Merge pull request #195 from Vlatombe/ JENKINS-14026 JENKINS-14026 DefaultBuildChooser should handle smartly branches with / Compare: https://github.com/jenkinsci/git-plugin/compare/dcae49362fc1...b22146d14997
            Hide
            markewaite Mark Waite added a comment -

            Branch names containing slashes and tag based checkout are both supported since git client plugin 1.10.0 through the commit submitted by Alexander Link. The online help for the "Branches to build" field has been updated to explain the extended syntax.

            The extended syntax allows the plugin to continue supporting the old format branch specifiers and still allow specification of branch names with embedded slash characters (like develop/my-branch). The extended syntax also allows checkout of tags.

            Show
            markewaite Mark Waite added a comment - Branch names containing slashes and tag based checkout are both supported since git client plugin 1.10.0 through the commit submitted by Alexander Link. The online help for the "Branches to build" field has been updated to explain the extended syntax. The extended syntax allows the plugin to continue supporting the old format branch specifiers and still allow specification of branch names with embedded slash characters (like develop/my-branch). The extended syntax also allows checkout of tags.

              People

              • Assignee:
                Unassigned
                Reporter:
                hayafirst Yi Wen
              • Votes:
                4 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: