What's new in Git 2.52: commands, performance, and security

  • New commands: git last-modified, git repo and additions to git refs for common operations.
  • Improved maintenance: geometric task in git maintenance and multiple performance optimizations.
  • Security in progress: first steps towards SHA-1/SHA-256 interoperability and a default change to "main" in the next major release.
  • More utilities: improvements to Bloom filters, sparse-checkout clean and new features in commit-graph, stash and diff-tree.

go to 2.52

Go to 2.52 It is now available as a stable update to this popular distributed version control system. The version comes with New features, maintenance adjustments, and performance improvements The result of the work of more than 94 collaborators, 33 of them for the first time in the project.

Among the most notable changes are new subcommands for exploring repositories, a smarter maintenance workflow, and progress toward the transition to SHA-256. All of this is delivered with a consistent and understated approach, with practical approach that manage repositories of varying sizes.

New git 2.52 commands for exploring repositories

The most striking novelty is git last-modifiedDesigned to efficiently obtain the most recent commit that touched each path. In repositories with many entries, this approach avoids repeated history traversals and can be several times faster than chaining ls-tree + logAccording to internal tests, reducing times from seconds to milliseconds in real-world scenarios.

Engine last-modified It was developed over years on GitHub under the name blame-treefeeding their tree-level "blame" since 2012. Subsequently, GitLab engineers They polished the patch set to integrate it into Git 2.52, although there are still features to be added, such as a disk format to cache results from previous executions.

The experimental one also arrives git repoAn umbrella for consulting repository features. With git repo info can you tell if it is optional o shallow, the format of objects and references, and with git repo structure are printed structural statistics (commit counts, trees, blobs, branches, tags, etc.). Furthermore, info incorporates the abbreviated option -z and is capable of report the object format used.

For those who work at a low level with references, git refs the amount git refs list (alias of git for-each-ref) and git refs exists (similar to git show-ref --existsThey don't offer unprecedented capabilities, but they concentrate frequent operations of references under a single command.

Small but useful: now git cmd --help-all It also works outside of a repositoryThis makes it easy to access global help without needing to initialize anything.

Maintenance and performance

Git 2.52 introduces a task geometric within git maintenance It avoids all-in-one repacks whenever possible and prunes unreachable objects less frequently. The task inspects the packages to form a geometric progression by number of objects and compact without pruning when appropriate; if the operation would end in a single pack, perform a git gc complete for consolidating and pruning.

In terms of speed, there are measurable advances: git describe It now uses a priority queue and gains around a 30% performance; git remote rename optimizes reference renaming; git ls-files It keeps the index dispersed in more cases; git log -L It avoids certain tree-level diffs in merges, speeding up analysis; and the library xdiff It incorporates several optimizations that Diff and merge are improved at file level.

Security and roadmap to Git 3.0

The transition from SHA-1 to SHA-256 continues. The first elements of SHA-256 appear in version 2.52. interoperability between algorithmsThe goal is to allow repositories with different hashes to exchange changes seamlessly. It's still groundwork, but it paves the way for the next major release.

Another change planned for Git 3.0 is that the default branch will be called "main". This has been included since version 2.52. clues and help messages To facilitate that change, and anyone who wants to get ahead can compile with the flag WITH_BREAKING_CHANGES to test planned behaviors.

It also includes, as an option, Rust code protected by WITH_RUSTwhich implements encoding/decoding of variable-width integers. In this version it is not mandatory and Git 2.52 works without the Rust compiler, but Git 3.0 is expected to require it and expand the rewritten pieces.

Improvements in workflows and usability

The use of changed-path Bloom filtersA probabilistic filter that speeds up journeys when they are narrowed down by routes. Now they are used even when the pathspec contains partial wildcards (for example, foo/bar/*/baz) and in scenarios with multiple routes of interest, benefiting queries such as those of last-modified and several history commands.

git sparse-checkout add the action clean To resolve cases where, when the definition of areas of interest is changed, files are left out of the selection. With a single step, you can clean the working tree of unwanted elements.

Other useful additions: new variable commitGraph.changedPaths to activate by default --changed-paths en git commit-graph; option stash.index for git stash pop/apply behaves as if it were invoked with --index; git diff-tree recibe --max-depth; git fast-import now manages signed labels, and git repo info Learn to report object format in addition to support for -z.

Git 2.52 availability

The source code for Git 2.52 can be downloaded from the Official site to compile it locally. It should arrive in the coming days and weeks. repositories of the main distributions GNU/Linux in Europe (Debian, Ubuntu, Fedora, openSUSE, Arch, etc.) already have managers like Homebrew, MacPorts or Chocolatey, with the usual packaging times.

With this release, Git strengthens its daily operations with faster and more useful commandsA more streamlined maintenance routine and the first building blocks of the transition to SHA-256 are now in "main" as the default branch. Those who upgrade can now test it. git last-modifiedThe new git repothe geometric task of git maintenance and the rest of the adjustments that, without making a sound, smooth the experience in small and giant repositories alike.

GitLab Duo Agent
Related article:
GitLab Duo Agent Platform: The new era of DevSecOps collaboration with AI agents