title | layout | date | author | categories | navbar | |
---|---|---|---|---|---|---|
Git Rev News Edition 88 (June 30th, 2022) |
default |
2022-06-30 12:06:51 +0100 |
chriscool |
|
false |
Welcome to the 88th edition of Git Rev News, a digest of all things Git. For our goals, the archives, the way we work, and how to contribute or to subscribe, see the Git Rev News page on git.github.io.
This edition covers what happened during the months of May and June 2022.
-
Google Summer of Code contributors working on Git are now in the "Coding Period" (from June 13 to September 19) of the program and have posted at least once on their blogs:
-
Abhradeep Chakraborty, who works on "Reachability bitmap improvements", has published his latest post on his Medium blog.
-
Shaoxuan Yuan, who works on "More Sparse Index Integrations" has published his latest post on his website.
-
Jaydeep Das, who works on "Unify ref-filters with other pretty formats" has published his latest post on his website.
-
-
Bug in merge-ort (rename detection can have collisions?)
Glen Choo reported on the mailing list that
git merge
was failing on certain branches of a repo used at his workplace. As the repo is a public one, Glen was able to share the full recipe to reproduce the bug.When following it, this error appears:
Assertion failed: (ci->filemask == 2 || ci->filemask == 4), function apply_directory_rename_modifications, file merge-ort.c, line 2410.
Glen noticed that the bug seemed to be specific to the "ort" merge strategy, which became the default merge strategy in Git 2.34.0 released last November. When using the "recursive" strategy, which used to be the default merge strategy before "ort" took over, the merge seemed to work as expected.
Glen also tried to debug the issue by himself and found that the reason for the assertion failure seemed to be that two files involved in the merge were renames of each other.
Elijah Newren, who developed the new "ort" strategy, thanked Glen for the detailed report, and said that he found a small reproduction recipe to simplify what's going on. He explained it with the following sequence:
# Commit O: sub1/file, sub2/other
# Commit A: sub3/file, sub2/{other, new_add_add_file_1}
# Commit B: sub1/{file, newfile}, sub1/sub2/{other, new_add_add_file_2}
#
# In words:
# A: sub1/ -> sub3/, add sub2/new_add_add_file_1
# B: sub2/ -> sub1/sub2, add sub1/newfile, add sub1/sub2/new_add_add_file_2
He noted, though, that he can also trigger a different fatal error in the "ort" strategy with a small tweak to the test setup, and can also trigger that same other fatal error in the "recursive" strategy with his test cases.
He then explained that both the "ort" and "recursive" merge strategies have code to avoid "doubly transitive [directory] renames". Such renames happen when, for example, on one side of the merge a directory named "A" is renamed to "B", while on the other side "B" is renamed to "C".
However, the code to avoid "doubly transitive [directory] renames" is fooled when a parent directory of a directory is renamed. For example if on one side a directory named "A" is renamed to "B", while on the other side a leading directory of "B" is renamed to "C". That still wouldn't be quite enough to trigger this bug, though. It also requires adding a file into directory A on one side and a file with the same name into directory B on the other.
Junio Hamano, the Git maintainer, thanked Elijah for his continued support of the merge strategy, and noticed that at least the code was not "making a silent mismerge" in this special case, and that the recursive strategy could be used as a fallback.
Elijah replied that he was glad the recursive strategy worked for Glen but noted that it didn't work with his minimal reproduction test case, which suggests it's less reliable as a fallback than one might hope.
Glen then wondered if turning off rename detection could help in case of merges with complex renames like this, but Elijah pointed out that might be more problematic than helpful, particularly since this case had a very large number of renames and users tend to have difficulty correctly resolving the conflicts that result from a lack of rename detection. However, he suggested that if turning off rename detection was really wanted that one could use the "resolve" strategy instead, which "is roughly the recursive strategy minus the renames and the multiple merge base handling".
Elijah also posted a small patch series that adds test cases demonstrating the bug Glen found and the related ones he found based on it, and fixes the bugs in the ort strategy. (The recursive strategy is deprecated, and the bugs noted here are not security critical.)
Jonathan Tan reviewed the series and verified that it indeed fixes Glen's test case. Calvin Wan also commented on the patch series. So there is good hope that after a few iterations to polish the series the bugs will be fixed soon.
- Git 2.37.0, 2.37.0-rc2, 2.37.0-rc1, 2.37.0-rc0
- Git for Windows 2.37.0(1), 2.37.0-rc2(1), 2.37.0-rc1(1), 2.37.0-rc0(1)
- Bitbucket Server 8.2
- Gerrit Code Review 3.6.1
- GitHub Enterprise 3.5.1, 3.4.4, 3.3.9, 3.2.14, 3.1.22
- GitLab 15.1 15.0.3, 15.0.2, 15.0.1, 14.10.4, and 14.9.5
- GitHub Desktop 3.0.3, 3.0.2, 3.0.1
- Tower for Mac 8.3
- Tower for Windows 3.3
Events
- Git Merge 2022 by Lee Reilly on GitHub blog. Git Merge, the conference dedicated to bringing the Git community together, returns on September 14-15 in Chicago, Illinois, USA. Call for Speakers is open through Sunday, July 10.
Various
- Highlights from Git 2.37 by Taylor Blau on GitHub's blog.
- v2.37.0 highlights video by GitKraken.
- How Atlassian made Git push over HTTPS faster for Bitbucket Cloud by Brent Thew on Atlassian Engineering blog.
- Why We’re Sticking with Ruby on Rails at GitLab by Sid Sijbrandij on The New Stack (contributed post, sponsored by GitLab).
- Improved verification of historic Git commit signatures [in GitHub] with respect to public GPG signing keys that are expired or revoked (but not compromised).
- AppSmith Adds Git Support to Low-Code App Dev Framework by Mike Vizard on DevOps.com.
- Improve Git monorepo performance with a file system monitor by Jeff Hostetler on GitHub's blog.
Light reading
- Improvements in git 2.37 when resolving conflicts with vimdiff describes a change in Git 2.37 w.r.t. vimdiff mergetool drivers.
- Better File Comparison with Kaleidoscope by Bruno Brito on Tower’s blog.
- Working with Feature Branches by Bruno Brito on Tower’s blog.
- Coming Up on Tower's Roadmap by Bruno Brito on Tower’s blog.
- The Three Phases of Software Development by Kristian Lumme on Tower’s blog.
- Best practices for Git branching, describing Git flow at Halodoc, by Ashish Anand.
- How to Recover a Deleted File in Git – Revert Changes After a Hard Reset by Zaira Hira on freeCodeCamp.
- Git List Remote Branches by Quincy Larson on freeCodeCamp.
- Replacing Your Git Command Cheat Sheet With AI Command Search by Jessica Wang on Warp blog; uses Warp's AI Command search.
- We Put Half a Million files in One git (Mono-)Repository, Here’s What We Learned
by Ahn Lee in Canva Engineering Blog (a Medium-based blog).
- See also, for example, articles on Developer Homepage of Derrick Stolee, including The Future of Git at Scale 2021 presentation (slides available), a survey of some advanced Git features to help Git scale to the largest monorepos.
- Reducing the size of a git repository with git-replace by Andrew Lock on andrewlock.net, where repository is split into a small "current" repository containing a minimal amount of history, and a "history" repository containing all the commits prior to the creation of the new repository, stitched together when needed with git-replace.
- How to Prevent Merge Conflicts (or at least have less of them) by Rizèl Scarlett, featured on daily.dev (also on DEV.to). It is the last part of 3 part Intro to Git series on DEV.to, beginning with How Do I Resolve Merge Conflicts?.
- People rarely use complicated git commands on the weekend, and I have the data to prove it. by Ben Halpern for The DEV Team on DEV.to.
- How Git truly works by Alberto Prospero in Towards Data Science (a Medium-based blog).
- Sourceware – GNU Toolchain Infrastructure roadmap by Mark J. Wielaard
Git tools and sites
- Sourceware is community run infrastructure, mailing lists, git, bug trackers, wikis, etc. hosted in the Red Hat Open Source Community Infrastructure Community Cage. Uses shared buildbot for (test) automation, and patchwork for tracking the state of contributions; most tests upload all results to bunsendb. Uses mirror at SourceHut, https://sr.ht/~sourceware/, for web forge.
- unix-history-repo is a repository representing a reconstructed version of the Unix history from 1970 until today, based on the currently available data. Note that this repository will be often automatically regenerated from scratch.
- git-repair can repair various forms of damage to Git repositories;
a complement to
git fsck
, which finds problems, but does not fix them. It is a Haskell program, developed as a spinoff of git-annex (for large files management). - Rich Enhanced Shell History (resh) provides contextual shell history for zsh and bash, where relevant results are based on current directory, git repo, exit status, and host.
This edition of Git Rev News was curated by Christian Couder <[email protected]>, Jakub Narębski <[email protected]>, Markus Jansen <[email protected]> and Kaartic Sivaraam <[email protected]> with help from Bruno Brito, Elijah Newren, Matheus Tavares and Johannes Schindelin.