55807886701e77dc8473b100661335orig

Git 2.9 improves submodules, diff readability

The open source Git distributed version control system, the cornerstone of the GitHub code-sharing site, has been upgraded with faster submodules and improvements for diffs and testing.

Version 2.9, released this week, expands options for submodules, which enable users to keep another Git repository in a subdirectory of a repository. The submodule improvements focus on speed and flexibility.

"In the last release, we showed you how to use the --jobs=<N> option to fetch submodules in parallel, which can be a real time saver," said Jeff King, GitHub infrastructure engineering manager. "Now you can also use the --jobs option when cloning or updating submodules." To always process submodules in parallel, users can set up submodule.fetchJobs config option.

Git's diff engine has a new heuristic for clarity in version 2.9. Diffs primarily show changes, additions, and deletions, King explained. "But because Git generates the diff only from seeing the 'before' and 'after' states of your files, sometimes the way it shows the changes can be pretty confusing." The upgrade's heuristic tries to show exactly what the author wrote. "This new heuristic is still experimental, and may change in the future or even become the default," King said. "For now, you can enable it with the --compaction-heuristic option on the command line, or by setting diff.compactionHeuristic in your git config." Additionally, rename detection is now enabled by default for diffs.

Version 2.9 makes it easier to test full branches via Git's interactive rebase capability. "At its heart, interactive rebase is really just a recipe of instructions to follow: pick this commit, then squash that one, now edit the message on this one, and so on," said King.

Rebasing is replaying a series of commits on a new base. "Among other things, this can be used to organize your work and show it was a clean, logical series of commits for reviewers," King said.

King also stressed the importance of the Git project to GitHub. "GitHub relies on Git in two ways. One, it is the client software used by the majority of our customers to create and work on the repositories that we host. And two, our server-side infrastructure uses Git at its core to interact with the repository data," he said.

IDG Insider

PREVIOUS ARTICLE

« This tiny PC proves AMD's APUs can power competitive gaming on a tight budget

NEXT ARTICLE

Surveillance reform measure blocked in the wake of Orlando killings »
author_image
IDG News Service

The IDG News Service is the world's leading daily source of global IT news, commentary and editorial resources. The News Service distributes content to IDG's more than 300 IT publications in more than 60 countries.

  • Mail

Recommended for You

Trump hits partial pause on Huawei ban, but 5G concerns persist

Phil Muncaster reports on China and beyond

FinancialForce profits from PSA investment

Martin Veitch's inside track on today’s tech trends

Future-proofing the Middle East

Keri Allan looks at the latest trends and technologies

Poll

Do you think your smartphone is making you a workaholic?