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

git plugin: tags from submodules are incorrectly fetched into parent repository

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • git-plugin
    • None
    • Hudson 1.385, git plugin 1.1.3, Windows XP sp3, Java 1.6.0_18

      I have upgraded the git plugin from 0.8 to 1.1.3 (under Hudson 1.385) and I'm seeing a new problem with submodules and tags. It appears that tags within a submodule are always fetched into the main (i.e. parent) clone. This has build-terminating results in my case, as there are special tags in a submodule that end up in the parent, and are misinterpreted by various build scripts. This is essentially a show-stopper at my site.

      In this example, there's a submodule called 'build-scripts' that is bound to the path 'build' within the parent clone (DAC16_v2):

      """
      Cloning the remote Git repository
      Cloning repository origin
      $ c:\cygwin\bin\git.exe clone -o origin git://gitsj/git/sp/modules/DAC_16v2.git C:\hudson\jobs\DAC_16v2-release-1.0\workspace
      Fetching upstream changes from git://gitsj/git/sp/modules/DAC_16v2.git
      [workspace] $ c:\cygwin\bin\git.exe fetch -t git://gitsj/git/sp/modules/DAC_16v2.git +refs/heads/:refs/remotes/origin/
      [workspace] $ c:\cygwin\bin\git.exe rev-parse origin/release-1.0
      Commencing build of Revision 2301bed44fa71fb71b60507ae534bcff4bbee324 (origin/release-1.0)
      GitAPI created
      Checking out Revision 2301bed44fa71fb71b60507ae534bcff4bbee324 (origin/release-1.0)
      [workspace] $ c:\cygwin\bin\git.exe checkout -f 2301bed44fa71fb71b60507ae534bcff4bbee324
      [workspace] $ c:\cygwin\bin\git.exe submodule init
      [workspace] $ c:\cygwin\bin\git.exe submodule sync
      Fetching upstream changes from git://gitsj/git/sp/modules/DAC_16v2.git
      [workspace] $ c:\cygwin\bin\git.exe fetch -t git://gitsj/git/sp/modules/DAC_16v2.git +refs/heads/:refs/remotes/origin/
      [workspace] $ c:\cygwin\bin\git.exe ls-tree HEAD
      Trying to fetch build into C:\hudson\jobs\DAC_16v2-release-1.0\workspace\build
      GitAPI created
      Fetching upstream changes from git://gitsj/git/sp/tools/build-scripts.git
      [build] $ c:\cygwin\bin\git.exe fetch -t git://gitsj/git/sp/tools/build-scripts.git +refs/heads/:refs/remotes/origin/
      warning: no common commits
      From git://gitsj/git/sp/tools/build-scripts + f94c6f4...ee4c0c9 master -> origin/master (forced update)

      • [new branch] ngo-dependencies -> origin/ngo-dependencies
      • [new tag] released-1.0 -> released-1.0
      • [new tag] released-1.1 -> released-1.1
      • [new tag] released-1.2 -> released-1.2
      • [new tag] released-1.3 -> released-1.3
        ...
        [workspace] $ c:\cygwin\bin\git.exe submodule update
        ...
        """

      You can see around the "warning: no common commits" that the plugin is fetching from the submodule (build-scripts.git)!

      """
      Trying to fetch build into C:\hudson\jobs\DAC_16v2-release-1.0\workspace\build
      ...
      Fetching upstream changes from git://gitsj/git/sp/tools/build-scripts.git
      """

      That's not right. Those new branches and tags are in the submodule but are being fetched into the parent. It shouldn't be doing this.

      Building new jobs, or 'clear workspace' then 'build' on existing jobs, exhibit this incorrect behaviour.

      Originally found in git plugin 1.1, Hudson 1.380.

            abayer Andrew Bayer
            dantliff David Antliff
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: