Uploaded image for project: 'BuildTools'
  1. BuildTools
  2. BUILDTOOLS-614

Shallow git clone & fetch - Reduce traffic & costs

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • All environments:

      • Windows
      • Linux (Debian)
      • Mac

      Requirement: git in `PATH`

    • git-BuildTools-e350a44-141 (#141)
    • Yes

      This is just a suggestion to switch to a shallow git clone & fetch in the BuildTools using the `--depth=1` option.

      Currently the `BuildTools` git clone & fetch operations download the complete git history of SpigotMC since ancient times. This commit history is very large (because of many commits). Git offers a solution to only get the latest state of the repository via `--depth`.

      Contra:

      • Replacement for `org.eclipse.jgit.api`.
          The currently used git library does not support the `--depth` option. 
      • Maybe a little more implementation effort? E.g.: `Runtime.exec("git clone ...")`

      Pro:

      • `--depth=1`, means:
        • less traffic,
        • faster build times (local),
        • less costs for hosting hub.spigotmc.org
      • A replacement for `jgit` could be the direct command call of `git`. One dependency less and a direct call of the dependent command. In my mind this is a win.

      Why?
      I'm building SpigotMC in a container without any fancy "caching" yet. So it does a "fresh" git clone and pull from the repo, which obviously creates a lot of traffic since it has to fetch the complete git history of SpigotMC.
      I would like to reduce that pull-time & traffic, but `dont-update` doesn't work with `rev`.
      Oh, and of course I'm hitting some kind of traffic firewall that nukes the speed of `git clone`.

            Unassigned Unassigned
            mickare Michael
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: