This plugin is really good. But currently it doesn't support "Multiple SCMs plugin". If I configure the job with multiple Git repos it wont detect branches.

      This would be a very good feature.

        1. git parameter.jpg
          git parameter.jpg
          12 kB
        2. screenshot-1.png
          screenshot-1.png
          12 kB
        3. screenshot-2.png
          screenshot-2.png
          23 kB
        4. screenshot-3.png
          screenshot-3.png
          22 kB
        5. screenshot-4.png
          screenshot-4.png
          24 kB

          [JENKINS-26799] Multiple SCMs plugin support

          Boguslaw Klimas added a comment - - edited

          nfalco79 This is very good POC but

          You may not have defined SCM when you add parameter or SCM definition can change after add parameter. Then you not have the actual information about SCM in parameter definition.

          I think good and simple solution is a:
          Add two option:

          • MultipleSCM: FIRST, ALL, MATCH_REPOSITORY_URL (combo)
          • MultipleSCM Url: ______ (text field - regexp)

          'FIRST' is default value.
          If you choose 'FIRST' - plugin will take data from first defined SCM (git repository)
          'ALL' plugin take data from all defined SCM
          'MATCH_REPOSITORY_URL' plugin will take data from all SCM which url match from regular expression.

          The advantage of this solution is: you do not need know about defined SCM. and this and this is more flexible solution.

          Perhaps is enough option 'MATCH_REPOSITORY_URL' and adding one text field to configuratin.

          Regards
          Boguslaw

          Boguslaw Klimas added a comment - - edited nfalco79 This is very good POC but You may not have defined SCM when you add parameter or SCM definition can change after add parameter. Then you not have the actual information about SCM in parameter definition. I think good and simple solution is a: Add two option: MultipleSCM: FIRST, ALL, MATCH_REPOSITORY_URL (combo) MultipleSCM Url: ______ (text field - regexp) 'FIRST' is default value. If you choose 'FIRST' - plugin will take data from first defined SCM (git repository) 'ALL' plugin take data from all defined SCM 'MATCH_REPOSITORY_URL' plugin will take data from all SCM which url match from regular expression. The advantage of this solution is: you do not need know about defined SCM. and this and this is more flexible solution. Perhaps is enough option 'MATCH_REPOSITORY_URL' and adding one text field to configuratin. Regards Boguslaw

          Nikolas Falco added a comment -

          klimas7 I have some doubts about FIRST and ALL value option.

          • FIRST not work if no SCM defined and maybe I would have the commit or TAG value to do some kinds of work based on parameter value without source code (for example download binary deployed on artifactory with release tag).
          • ALL could be a very confusing if BRANCH or REVISION are selected and more than one SCM is defined
            So the really useful choise is MATCH_REPOSITRY_URL but also in this case you could not use it when no SCM is defined.

          The SVN strategy is very simple and usable

          You always put the complete git URL and you could also select credential stored in jenkins so more issue JENKINS-28597

          Nikolas Falco added a comment - klimas7 I have some doubts about FIRST and ALL value option. FIRST not work if no SCM defined and maybe I would have the commit or TAG value to do some kinds of work based on parameter value without source code (for example download binary deployed on artifactory with release tag). ALL could be a very confusing if BRANCH or REVISION are selected and more than one SCM is defined So the really useful choise is MATCH_REPOSITRY_URL but also in this case you could not use it when no SCM is defined. The SVN strategy is very simple and usable You always put the complete git URL and you could also select credential stored in jenkins so more issue JENKINS-28597

          Boguslaw Klimas added a comment - - edited

          Hi nfalco
          The solution to this issue is only part of a larger issue JENKINS-39530.
          Finally I will add only one new option in configuration 'Use repository', this option will be a regular expression. It will be taken into account only, when is defined more then one SCM in job.
          When properties is empty plugin get first SMC from job.

          From my perspective, any change must be transparent for current user.
          Regards
          Bogusław

          Boguslaw Klimas added a comment - - edited Hi nfalco The solution to this issue is only part of a larger issue JENKINS-39530 . Finally I will add only one new option in configuration 'Use repository', this option will be a regular expression. It will be taken into account only, when is defined more then one SCM in job. When properties is empty plugin get first SMC from job. From my perspective, any change must be transparent for current user. Regards Bogusław

          Boguslaw Klimas added a comment - https://github.com/jenkinsci/git-parameter-plugin/pull/41

          Release 0.7.1

          Boguslaw Klimas added a comment - Release 0.7.1

          Oleksii Shevchenko added a comment - - edited

          Apparently does not work when your second SCM cloned to subdir (GIT).

          Oleksii Shevchenko added a comment - - edited Apparently does not work when your second SCM cloned to subdir (GIT).

          Hi felikz
          I reopen this isssue and i will try to fix this

          Boguslaw Klimas added a comment - Hi felikz I reopen this isssue and i will try to fix this

          klimas7 Thanks. So I have 2 git repositories. First is cloned at root of workspace, second to subdir of first repo. Having this setup I am not able to Regexp second repo, only first matching.

          Oleksii Shevchenko added a comment - klimas7 Thanks. So I have 2 git repositories. First is cloned at root of workspace, second to subdir of first repo. Having this setup I am not able to Regexp second repo, only first matching.

          Code changed in jenkins
          User: Boguslaw Klimas
          Path:
          src/test/java/net/uaznia/lukanus/hudson/plugins/gitparameter/GitParameterDefinitionTest.java
          http://jenkins-ci.org/commit/git-parameter-plugin/6336b41960434597180ab883b81d8e26e03b3641
          Log:
          Merge pull request #45 from jenkinsci/feature/JENKINS-26799

          Multiple SCMs plugin support

          Compare: https://github.com/jenkinsci/git-parameter-plugin/compare/570bf0fbb7b0...6336b4196043

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Boguslaw Klimas Path: src/test/java/net/uaznia/lukanus/hudson/plugins/gitparameter/GitParameterDefinitionTest.java http://jenkins-ci.org/commit/git-parameter-plugin/6336b41960434597180ab883b81d8e26e03b3641 Log: Merge pull request #45 from jenkinsci/feature/ JENKINS-26799 Multiple SCMs plugin support Compare: https://github.com/jenkinsci/git-parameter-plugin/compare/570bf0fbb7b0...6336b4196043

          release 0.8.1

          Boguslaw Klimas added a comment - release 0.8.1

            klimas7 Boguslaw Klimas
            xfreebird Nicolae Ghimbovschi
            Votes:
            7 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: