| title | Git Rev News Edition 81 (November 29th, 2021) | |
|---|---|---|
| layout | default | |
| date | 2021-11-29 12:06:51 +0100 | |
| author | chriscool | |
| categories |
|
|
| navbar | false |
Welcome to the 81st 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 month of October 2021.
-
[PATCH 0/3] Fun with cpp word regex
Johannes Sixt sent a small patch series about improving C++ (also called 'cpp') support in the userdiff mechanism. This mechanism is used by Git to generate diffs that are customized to specific programming languages (like C, shell, Perl, MATLAB, etc.) or markup languages (like HTML, Markdown, TeX, etc.).
Especially one of the patches splits the regex that was matching all the numbers into 3 different regexes:
- one for floating point numbers that begin with a decimal point,
- one for decimal and octal integers as well as other floating point numbers, and
- one for hexadecimal and binary integers.
The result is that expressions like
1+2,1.5-e+2+fand.lare not considered numbers any more and are properly parsed for diff purposes in C++ files.Another patch in the series allows single-quote characters as digit separators according to the C++17 standard, like in
3.141'592'654or0xdead'beaf.The third and last patch prevents the
<=>generalized comparison operator (also called 'spaceship' operator) introduced in C++20 from being split into<=and>.Ævar Arnfjörð Bjarmason replied to Johannes suggesting to add a few tests in the
t/t4034/cpp/directory, where test files for the cpp userdiff mechanism reside.Johannes agreed with Ævar and sent a second version of his patch series. This series included 2 new patches that improved existing tests and added new tests for problematic behavior that the other patches were fixing.
Ævar commented on this series saying that it was much improved, but it could perhaps be even better if:
-
the C++ support was split up from the C support,
-
some tests were added first, before the behavior was changed, and
-
some tests could be added for code comments, as he wondered if tokens that often occur in natural language, like
"and&, were still correctly handled when they appeared in code comments.
Johannes agreed with the second point, but wasn't interested in working on the others.
Ævar and Johannes discussed a bit further if it was worth doing something for code comments, but Johannes concluded that it wasn't.
Johannes then sent a third version of his patch series. In this new version test cases for single-quote characters as digit separators and the
<=>generalized comparison operator were moved to a new commit before the commits supporting these features.Later on, Johannes noticed that the single-quote character as digit separator is problematic and requires a more sophisticated implementation. For example, as implemented the character literal
'.'would be split into'.and'. The support for digit separators was eventually reverted.This patch series was then merged into the master branch, so that Git 2.34 that was recently released has better support for C++ in diffs.
- Git 2.34.0, 2.34.0-rc2, 2.34.0-rc1, 2.34.0-rc0
- Git for Windows 2.34.0(1), 2.34.0-rc2(1), 2.34.0-rc1(1), 2.34.0-rc0(1)
- Bitbucket Server 7.18
- GitHub Enterprise 3.3.0, 3.2.3, 3.1.11, 3.0.19, 3.2.2, 3.1.10, 3.0.18
- GitLab 14.5 14.1.8, 14.4.2, 14.0.12, 13.12.15, 14.4.1, 14.3.4, and 14.2.6
- Gerrit Code Review 3.4.2, 3.3.8, 3.2.14, 2.16.28
- GitKraken 8.1.1
Various
- Derrick Stolee and Lessley Dennington talk about the future of Git at scale.
- Highlights from Git 2.34
by Taylor Blau on GitHub Blog, and
Git 2.34 sets new merge default, speeds things up for monorepo users by Julia Schmidt on Dev Class. - Require pull requests without requiring reviews on GitHub.
- Deprecating Atlassian account password for Bitbucket API and Git activity (for Git over HTTPS) on Bitbucket.
Light reading
- Get lazy with lazygit by Tahsin on DEV.to. Lazygit was first mentioned in Git Rev News Edition #42 (August 22nd, 2018).
- Should You Use HTTPS or SSH For Git? by Anthony Heddings on Cloud Savvy IT.
- How To Switch a GitHub Repository to SSH Authentication by Anthony Heddings on Cloud Savvy IT.
- 5 Underrated [free] resources to learn Git and GitHub
by ifrah on DEV.to.
- GitHub Minesweeper by Profy was mentioned in Git Rev News Edition #80 (October 30th, 2021).
- Oh My Git! game by bleeptrack and blinry was mentioned in Git Rev News Edition #72 (February 27th, 2021).
- The “Advanced Git” series by Tobias Günther on CSS-Tricks, courtesy of the Tower Git client, (mentioned in Git Rev News #80), continues:
- How to become a Git expert! by Sagar Barapatre on DEV.to.
- What is .gitkeep? How to Track and Push Empty Folders in Git. by Kealan Parr on freeCodeCamp.
- How to Write Good Commit Messages with Commitlint by Anish De on freeCodeCamp.
- Removing a .env file from Git history (or any other accidentally added, committed, and pushed file) by Chris Bongers on Daily Dev Tips.
- The case against monorepos by Lee Atchison on Info World.
- How to do pull request reviews by Mage company on DEV.to.
- Git Rebase for Preventing Merge Commits by jen chan on DEV.to.
- Signed git pushes by Konstantin Ryabitsev (2020).
- DeployBot Configuration with Git LFS by Markus Cadonau (2020).
Git tools and sites
commitlintis a tool written in JavaScript and running on Node.js (that is, an npm tool) that helps your team with adhering to a commit convention.- Conventional Changelog is an npm tool to generate changelogs and release notes from a project's commit messages and metadata.
- Git Command Explorer is a web application to help you find the right commands you need without digging through the web, made by Summitech company.
- Arlo's Commit Notation is a notation for small commit messages that shows the risk involved in each step and the author's intention, conveyed in the first 3 characters of the commit summary line.
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 Johannes Schindelin and Johannes Sixt.