Our repository contains a variant of the git-flow branch naming convention, where you will see
      branches such as dev/main or release/3.2

      Using multibranch, strange things happen:

      • dev/main gets displayed as dev%2Fmain, then on restart dev%252Fmain, then dev%25252Fmain and all history seems to be lost.

      This is likely down to / being a dodgy delimiter for a project name. I tried to fix this by adjusting WorkflowBranchProjectFactory thusly:

      -        WorkflowJob job = new WorkflowJob((WorkflowMultiBranchProject) getOwner(), branch.getName());
      +        String branchName = branch.getName().replace("/", "-");
      +        WorkflowJob job = new WorkflowJob((WorkflowMultiBranchProject) getOwner(), branchName);
      

      but it didn't seem to help.

      Happy to try to fix if I can get a pointer as to what to look at.

          [JENKINS-30744] multibranch issues if branch contains /

          Varun Reddy added a comment -

          Is this issue being addressed in the coming release? Or is this has to be fixed by the build tools? In this msbuild and nuget.exe?

          Varun Reddy added a comment - Is this issue being addressed in the coming release? Or is this has to be fixed by the build tools? In this msbuild and nuget.exe?

          I couldn't figure this out either. If we use gitflow - we have to make sure that we don't use the default branch names:

          feature/myfeat

          bug/themess

          I don't know why this issue is marked as closed? What are we missing here?

           

          Philip O'Gorman added a comment - I couldn't figure this out either. If we use gitflow - we have to make sure that we don't use the default branch names: feature/myfeat bug/themess I don't know why this issue is marked as closed? What are we missing here?  

          Varun Reddy added a comment -

          Yes we are using git-flow and we are having same above issue as pogorman . Is there another defect that we need to track this issue? 

          Varun Reddy added a comment - Yes we are using git-flow and we are having same above issue as pogorman . Is there another defect that we need to track this issue? 

          Why is this issue closed? I mean any MSBuild run will fail with this conversion of "/". Many branching strategies include branch names that have a "/" in them. Pretty standard for Bitbucket installations as it defaults to.

          feature/

          hotfix/

          bugfix/

          release/

           

          Please reopen and convert to something less painful! 

          Timothy Harris added a comment - Why is this issue closed? I mean any MSBuild run will fail with this conversion of "/". Many branching strategies include branch names that have a "/" in them. Pretty standard for Bitbucket installations as it defaults to. feature/ hotfix/ bugfix/ release/   Please reopen and convert to something less painful! 

          Mark Waite added a comment -

          nemligtim please refer to the duplicate bug JENKINS-34564 which describes more details. This is a duplicate bug and the project prefers to close duplicates so that they don't clutter searches.

          Mark Waite added a comment - nemligtim please refer to the duplicate bug JENKINS-34564 which describes more details. This is a duplicate bug and the project prefers to close duplicates so that they don't clutter searches.

          Varun Reddy added a comment -

          The bug JENKINS-34564 also does not work for MSBuild. It fixes the longpath but not the issues with /

          Varun Reddy added a comment - The bug JENKINS-34564 also does not work for MSBuild. It fixes the longpath but not the issues with /

          Timothy Harris added a comment - - edited

          I got around this by giving it a specific workspace.

          agent {
              node {
                  label 'windows'
                  // Todo: This s really bad but Jenkins Multibranch is being very bad with very long paths being generated!
                  customWorkspace "${JOB_NAME}"
              }
          }

          I got around the conversion of "/" by changing the branching strategy in Bitbucket to feature-, hotfix-, release- instead of feature/, hotfix/, release/.

          Both of these are pretty frustrating. Especially the "/". 

          Timothy Harris added a comment - - edited I got around this by giving it a specific workspace. agent {     node {         label 'windows'         // Todo: This s really bad but Jenkins Multibranch is being very bad with very long paths being generated!         customWorkspace "${JOB_NAME}"     } } I got around the conversion of "/" by changing the branching strategy in Bitbucket to feature-, hotfix-, release- instead of feature/, hotfix/, release/. Both of these are pretty frustrating. Especially the "/". 

          Varun Reddy added a comment -

          I am currently using the Branching strategy to include - instead of / . But the default behavior in setting up git flow branches are / .

          Varun Reddy added a comment - I am currently using the Branching strategy to include - instead of / . But the default behavior in setting up git flow branches are / .

          Sanchit Jain added a comment - - edited

          jajansen, where did you add below code?

          public String getEncodedName()
          { return Util.rawEncode(getName()).replace("%2F","_"); }
          

           

          Sanchit Jain added a comment - - edited jajansen , where did you add below code? public String getEncodedName() { return Util.rawEncode(getName()).replace( "%2F" , "_" ); }  

          Sanchit Jain added a comment - - edited

          joostvdg, where did you add below code? -

          def getWorkspace()
          { pwd().replace("%2F", "_") }
          

           

          Sanchit Jain added a comment - - edited joostvdg , where did you add below code? - def getWorkspace() { pwd().replace( "%2F" , "_" ) }  

            jglick Jesse Glick
            magnayn magnayn
            Votes:
            14 Vote for this issue
            Watchers:
            47 Start watching this issue

              Created:
              Updated:
              Resolved: