Git 2.53 makes large repositories more manageable

Version control in version 2.53 simplifies working with large repositories, speeds up repacking, and handles commit signatures more precisely.

listen Print view
Packages on a conveyor belt

(Image: Nice to meet you / Shutterstock.com)

3 min. read
Contents

A new version of the distributed version control system, Git 2.53, is now available. The focus is primarily on improvements in handling large repositories and revisions to existing tools.

Git 2.53 addresses a long-standing limitation in so-called geometric repacking. In this process, Git organizes objects not in a single large pack file, but distributes them across multiple pack files of different sizes. The goal is to speed up repacking operations, especially in large repositories where repacking all objects can take a considerable amount of time.

Until now, this strategy was incompatible with Partial Clones – repository copies where Git initially downloads only a portion of the data and fetches missing content later as needed. Such repositories contain so-called Promisor Packfiles that refer to objects not yet present. Git 2.53 now handles these pack files separately and preserves their identification during geometric repacking. This allows the more efficient repacking strategy to be used in Partial Clone environments for the first time.

Videos by heise

Git 2.53 enhances the git-fast-import tool, which developers primarily use for fast import of large amounts of data and for rewriting repository histories. Such mass changes are used, for example, when employing tools like git-filter-repo, which selectively modify parts of the commit history.

A new additional mode for handling cryptographic signatures has been introduced. Previously, git-fast-import could only completely preserve or completely remove signatures with the option --signed-commits=<mode>. If developers rewrote only a part of the history, the affected commits lost their signature validity, but according to a GitLab blog post, Git also removed the valid signatures of unchanged commits. With Git 2.53, git-fast-import introduces the new strip-if-invalid mode. It only removes signatures if they become invalid due to a rewrite and preserves valid signatures of unchanged commits. This creates an important prerequisite for selectively preserving signatures during automated history manipulation.

Since Git 2.52, the subcommand git repo structure has provided insights into the structure of a repository. In Git 2.53, the project further expands this analysis function and adds additional metrics that allow for more precise examination of large repositories.

The command also determines the total size of reachable objects. Git displays both the uncompressed size and the actual disk space required, and breaks down the values by object type.

$ git repo structure

| Repository structure | Value      |
| -------------------- | ---------- |
| * References         |            |
|   * Count            |   1.78 k   |
|     * Branches       |      5     |
|     * Tags           |   1.03 k   |
|     * Remotes        |    749     |
|     * Others         |      0     |
|                      |            |
| * Reachable objects  |            |
|   * Count            | 421.37 k   |
|     * Commits        |  88.03 k   |
|     * Trees          | 169.95 k   |
|     * Blobs          | 162.40 k   |
|     * Tags           |    994     |
|   * Inflated size    |   7.61 GiB |
|     * Commits        |  60.95 MiB |
|     * Trees          |   2.44 GiB |
|     * Blobs          |   5.11 GiB |
|     * Tags           | 731.73 KiB |
|   * Disk size        | 301.50 MiB |
|     * Commits        |  33.57 MiB |
|     * Trees          |  77.92 MiB |
|     * Blobs          | 189.44 MiB |
|     * Tags           | 578.13 KiB |

The extended outputs are intended to help better assess the size and potential performance characteristics of a repository – especially with very extensive codebases.

(mdo)

Don't miss any news – follow us on Facebook, LinkedIn or Mastodon.

This article was originally published in German. It was translated with technical assistance and editorially reviewed before publication.