Skip to content

Latest commit

 

History

History
219 lines (181 loc) · 11.9 KB

File metadata and controls

219 lines (181 loc) · 11.9 KB
title Git Rev News Edition 81 (November 29th, 2021)
layout default
date 2021-11-29 12:06:51 +0100
author chriscool
categories
news
navbar false

Git Rev News: Edition 81 (November 29th, 2021)

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.

Discussions

Reviews

  • [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+f and .l are 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'654 or 0xdead'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.

Releases

Other News

Various

Light reading

Git tools and sites

  • commitlint is 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.

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 Johannes Schindelin and Johannes Sixt.