Git Rev News: Edition 108 (February 29th, 2024)
Welcome to the 108th 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 January and February 2024.
Discussions
Support
-
[Bug?] “
git diff --no-rename A B
”Junio Hamano, the Git maintainer, sent an email to the mailing list saying that when
git diff
was used with--no-rename
instead of--no-renames
, rename detection was still performed. He wondered if that was a bug, because either--no-rename
should be interpreted as being a shortened form of--no-renames
, which is a valid option and should disable rename detection, or--no-rename
should be rejected with an error message and termination ofgit diff
.Dragan Simic replied to Junio that indeed, in case the option is not recognized, an error message should be emitted.
Jeff King, alias Peff, also replied to Junio saying he tried
--no-foo
, which properly errored out. He then wondered if it could be a bug in theparse-options
code that could be confused becausegit diff
has both--[no-]rename-empty
and--no-renames
. As there is an abbreviation ambiguity between--no-rename-empty
and--no-renames
when--no-rename
is used, theparse-options
code should not allow such an abbreviation and should error out.He suggested, as an alternative to fixing the bug, that a new
--renames
option could be introduced. It would be synonymous to--find-renames
, which is currently the only opposite to--no-renames
. He proposed a patch to do that and showed that after his patch,--no-rename
would properly error out.René Scharfe replied to Peff that the issue came from a patch written in 2019 that disabled abbreviated options when there could be an ambiguity. The code handling abbreviations would trigger not only if the condition guarding it was satisfied, but also if it was reached through a
goto
statement. The patch disabling abbreviated options only took care of the condition guarding that code, but not of thegoto
statement. Along with these explanations, René provided a patch fixing the bug.Junio thanked René for spotting the “nasty” bug and said he agreed that the code was confusing.
René replied to Junio with a follow-up patch removing the
goto
statement.Peff also replied to René’s first patch wondering if it fixed all the possible issues, but then in a reply to himself agreed that René’s patch was indeed fixing all the issues discussed.
Junio later merged both of René’s patches, and they were part of the recently released Git versions 2.43.2, 2.43.3 and 2.44.0.
Bonus reading: “A Case against the GO TO Statement” by Edsger W. Dijkstra
Other News
Various
- The Git project has been accepted as a Mentor Organization for Google Summer of Code (GSoC) 2024. We can still add project ideas to our idea page, and volunteers to (co-)mentor are still welcome. Feel free to join the discussion in the corresponding thread. Also, feel free to spread the word about Git’s participation.
- Highlights from Git 2.44 by Taylor Blau on GitHub Blog.
- GitLab’s contributions to Git 2.44.0 by Patrick Steinhardt on GitLab Blog.
Light reading
- Git Tips and Tricks: a 3 part series
by Scott Chacon on GitButler blog,
accompanying the video from the talk
So You Think You Know Git - FOSDEM 2024
(available on YouTube); find the talk slides (and later the “official” video) in the FOSDEM archive.
- Git Tips 1: Oldies but Goodies:
conditional configs, git blame and log with line ranges (
-L
), git blame with following, word diff, resolution reuse (git rerere
). - Git Tips 2: Some Subtle New Things:
git branch stuff (
--sort
,--column
), safe force-pushing (--force-with-lease
), SSH commit signing, push signing,git maintenance
. - Git Tips 3: Really Large Repositories and Monorepos: prefetching, commit graph, filesystem monitor, partial cloning, sparse checkouts, the scalar tool.
- Git Tips 1: Oldies but Goodies:
conditional configs, git blame and log with line ranges (
- Git Trailers by Brooke Kuhlmann. Learn how to leverage commit metadata for powerful automations and more human-readable commit messages.
- More Expressive Commits with Gitmoji ☺️
by Bruno Brito on Tower’s blog.
- Gitmoji was first mentioned in Git Rev News Edition #47, though then under a different URL (which now redirects to the current one).
- The similar Emoji-Log commit log messages standard was mentioned in Git Rev News Edition #101.
- My Git pre-commit hook contained a footgun by Mark Dominus (陶敏修) on his blog (The Universe of Discourse).
- Julia Evans continues her series of blog posts about Git with Dealing with diverged git branches and Popular git config options. First entry in this series can be found in Git Rev News Edition #103.
- Git Battle: YOLO Mode vs. Clean History
by Hana Klingová on her blog (and also on DEV.to):
about usefulness of
git commit --fixup
andrebase.autosquash
. - Restore deleted/lost files with git by Leonardo Montini for This is Learning, part 6 of git better - Improve your git skills (6 Part Series). Originally published at leonardomontini.dev (includes video version).
- My favourite Git commit (2019)
by David Thompson on his blog,
about the benefits of good commit messages (the example is a one-character change).
Includes links to the following recommended articles on the same topic:- Telling stories through your commits by Joel Chippindale (2016).
- A branch in time by Tekin Süleyman (2019).
- Contribution experience report: Git by Antonin Delpeuch on his blog.
Easy watching
- So You Think You Know Git - FOSDEM 2024 by Scott Chacon on YouTube, 47 minutes long (mentioned above).
Git tools and sites
- Milestoner by Brooke Kuhlmann. Significant updates have been made where you can build release notes from your commit messages based on Git notes and trailers in multiple formats: console, AsciiDoc, Markdown, and HTML. Includes automatic calculation of your next version and automatic tagging.
- git-cliff is a highly customizable changelog generator using regex-powered custom parsers that can generate changelog files for any Git repository which follows the conventional commits specification. Written in Rust as a command-line application.
- LearnGit.io is an upcoming resource for learning Git using videos with motion graphics. The project is by Jack Lot who posts Git videos on The Modern Coder YouTube channel. Jack is looking for intermediate/advanced Git users for feedback. If interested email <jack@learngit.io>.
- pg-diff is a PostgreSQL schema and data comparing tool. Written in JavaScript by Michael Sogos.
- Another trivial utility: git-q by Mark Dominus
available from mjdominus personal git-util repository
as
git-q
. - Aho is a Git implementation in AWK. It is a toy project to explore some of the internals of Git and newer features of GNU AWK (aka Gawk).
Releases
- Git 2.44.0, 2.43.3, 2.44.0-rc2, 2.43.2, 2.44.0-rc1, 2.44.0-rc0, 2.43.1
- Git for Windows 2.44.0(1), 2.44.0-rc2(1), 2.44.0-rc1(1), 2.44.0-rc0(1)
- GitLab 16.9.1, 16.8.3, 16.7.6, 16.9, 16.8.2, 16.7.5, 16.6.7
- Gerrit Code Review 3.7.7, 3.8.4
- GitHub Enterprise 3.12.0, 3.11.5, 3.10.7, 3.9.10, 3.8.15, 3.11.4, 3.10.6, 3.9.9, 3.8.14
- GitKraken 9.12.0
- GitHub Desktop 3.3.9
- Sourcetree 4.2.7
- Tower for Mac 10.4
- git-credential-oauth 0.11.1
Credits
This edition of Git Rev News was curated by Christian Couder <christian.couder@gmail.com>, Jakub Narębski <jnareb@gmail.com>, Markus Jansen <mja@jansen-preisler.de> and Kaartic Sivaraam <kaartic.sivaraam@gmail.com> with help from Brooke Kuhlmann, Jack Lot, Štěpán Němec and Bruno Brito.