Git 2.33 Released with New Optional Merge Strategy Named ‘merge-ort’

Git 2.33

Git 2.33 improves things for avid scripters and puts new merge backend which is over 9,000 times faster.

Git is a distributed version control software that basically allows multiple people to work in parallel and it saves a history of all changes made. 

History of Git

In 2002, the Linux kernel team adopted BitKeeper. Linus Torvalds was among the proponents of the new system. However, other developers were concerned about using a proprietary tool to develop open source. In 2005 the company owned BitKeeper announced it would discontinue the free version.

So, Linus Torvalds urgently needed a new version control system to maintain the development of the Linux Kernel. So he went offline for a week, wrote a revolutionary new system from scratch, and called it Git. 

Sixteen years later, the platform is the undisputed leader in the distributed version control software field.

What’s New in Git 2.33

Git 2.33 has been released. It mainly dealt with bug fixes and a new strategy for carrying out merges. For those unfamiliar, a merge strategy is the mechanism used to combine code from multiple versions of the same codebase.

To merge two branches, Git currently uses the command, which was first written as an external Python script and then rewritten in C – merge-recursive.  Git 2.33 brings a new merge strategy called merge-ort.

Preparation work for a new merge strategy backend is now on its final stretch. Merge-ort is pitched as a complete re-write of the currently used recursive approach, that is meant to fix issues in areas like correctness, and performance. It has been rewritten from scratch with the same concepts of recursion and rename-detection.

 According to GitHub:

For a merge (but a large, tricky one containing many renames), merge-ort gains over a 500x speedup. For a series of similar merges in a rebase operation, the speedup is over 9000x.

This is due to the fact that the new algorithm in Git 2.33 will cache and reuse some computations common to the merges. On top of that, the resulting code is cleaner and easier to work with.

The new merge-ort is likely to become the default strategy in a future version of Git. Until then you can try this feature by running the git merge -s ort command.

Other than the above new feature, Git Project adds the following features to Git 2.33.0:

  • git worktree add --lock learned to record why the worktree is locked with a custom message.
  • git send-email learned the --sendmail-cmd command line option and the sendemail.sendmailCmd configuration variable, which is a more sensible approach than the current way of repurposing the smtp-server that is meant to name the server to instead name the command to talk to the server.
  • Several improvements around geometric repacking.
  • Git now using the hashfile API in the codepath that writes the index file to reduce code duplication.
  • git rev-list learns to omit the commit <object-name> header lines from the output with the --no-commit-header option.

More details on the changes with Git 2.33 can be found on the GitHub blog.

Leave a Reply

Your email address will not be published.

Latest from News