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

Add "repack after cloning" option to the 'reference' support in git clone

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • None

      I like using the --reference support in the additional clone options to provide a pre-cache for a remote git server, but would prefer that the cloned repositories not have the persistent 'alternates' referenced - even though the remotes are read only.

      Would like to see a checkbox in the 'Additional Clone Behaviors' config section for the reference to say "Repack after Clone" to run 'git repack -a'. This would obviously negate space savings, but still accomplishes the goal of avoiding network transfer when the primary repository is on a remote slow link.

          [JENKINS-26868] Add "repack after cloning" option to the 'reference' support in git clone

          Mark Waite added a comment - - edited

          I was impressed that one of the features added in git 2.3 is the "--dissociate" argument to the "git clone" command. When used with --reference, it reduces the network transfer by copying objects from the reference repository.

          I'm not sure this is sufficiently compelling to justify adding that feature to the git plugin, but the timing of the request is interesting.

          Mark Waite added a comment - - edited I was impressed that one of the features added in git 2.3 is the " --dissociate " argument to the "git clone" command. When used with --reference, it reduces the network transfer by copying objects from the reference repository. I'm not sure this is sufficiently compelling to justify adding that feature to the git plugin, but the timing of the request is interesting.

          Cool. That's a nice additional option in git. Sounds like it does equivalent to running a git repack -a afterwards, but probably a lot more efficient. Unfortunately, it'll be a while before 2.3 is available on many of the build agent systems, where 'git repack -a' works now.

          I'm just looking for something that would remove the dependency on the referenced repo after the cloning - to use it purely as a cache and not for live use. (Would be even nicer if the git plugin had some way of caching the repo on the master, but that's a major functionality change.)

          Seems like a checkbox to repack would be easy/simple way to accomplish that.

          Nathan Neulinger added a comment - Cool. That's a nice additional option in git. Sounds like it does equivalent to running a git repack -a afterwards, but probably a lot more efficient. Unfortunately, it'll be a while before 2.3 is available on many of the build agent systems, where 'git repack -a' works now. I'm just looking for something that would remove the dependency on the referenced repo after the cloning - to use it purely as a cache and not for live use. (Would be even nicer if the git plugin had some way of caching the repo on the master, but that's a major functionality change.) Seems like a checkbox to repack would be easy/simple way to accomplish that.

          kutzi added a comment -

          Is there any chance that we could get support for dissociate or repack soon?

          kutzi added a comment - Is there any chance that we could get support for dissociate or repack soon?

          Mark Waite added a comment -

          kutzi I'm not planning to add support for it any time soon. There is no pull request that includes it and no one has offered to create such a pull request.

          Mark Waite added a comment - kutzi I'm not planning to add support for it any time soon. There is no pull request that includes it and no one has offered to create such a pull request.

            Unassigned Unassigned
            nneul Nathan Neulinger
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: