Paul Krill
Editor at Large

Git 2.9 improves submodules, diff readability

news
Jun 17, 20162 mins

The latest version of the open source version control system features a diff heuristic for better clarity

upgrade underway
Credit: Ged Carroll

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.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author