Welcome to the 104th 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 September 2023 and October 2023.
Git Virtual Contributor’s Summit 2023
A virtual summit happened on September 26th and 27th, where the contributors discussed topics that they had previously voted on. Taylor Blau, who organized the summit, polished and then sent the notes that were taken during the summit to the mailing list.
[PATCH] diff –stat: add config option to limit filename width
Dragan Simic sent a patch to the mailing list that added a new
diff.statNameWidth=<width>
configuration option. The goal with
this option was to make it possible to limit the width of the
filepath part of the “stat” output of git diff
commands.
For example, the “stat” output of a git diff
command contains lines like this:
path/to/file.txt | 11 +++++++--
where the “filepath” part, also called “name” or “filename” part, of
that output is path/to/file.txt
and the “graph” part is
11 +++++++--
.
There were already a diff.statGraphWidth=<width>
configuration
option to limit the width of the graph part, and also
--stat-name-width=<width>
and --stat-graph-width=<width>
command
line options to limit the width of the name and graph part,
respectively. So it was logical to add the missing configuration
option.
These options are especially useful for people using very large terminals, to prevent “stat” output from using a lot of columns.
The new diff.statNameWidth=<width>
was designed to be ignored by
git format-patch
in the same way as
diff.statGraphWidth=<width>
, because that command already respects
the traditional 80-column standard.
Before sending this patch, Dragan had sent an RFC email asking if such a patch would be accepted, which led to an interesting discussion between him and Junio Hamano, the Git maintainer, about the fact that we often cannot promise anything about a hypothetical patch before actually seeing it on the mailing list.
Junio reviewed the actual patch and wondered if it would be possible to specify contradictory values for the whole width on one side and the “name” and “graph” width on the other side. He also suggested creating a helper function to initialize all the variables that contain the values of the configuration options for the different parts, as the code initializing those variables was duplicated in the code of many Git commands.
Dragan replied that the diff code already performed “a reasonable amount of sanity checks and value adjustments”. He wondered if warnings should be emitted in case of contradictory settings though.
Dragan then agreed that refactoring the code that initialized the variables would be nice, but he proposed to do it after the current patch would have been merged.
Junio and Dragan agreed with doing the refactoring later and discussed a bit deeper if more changes were needed in this patch, but it appeared that it could be merged as is, and so it was.
A few days later Dragan sent a patch to refactor the code that initialized the variables. Junio reviewed it and suggested some improvements, which Dragan implemented in a second version of the patch.
This second version was also reviewed by Junio and then merged.
Various
Light reading
--cached
” are all the same thing.git
directory?
by Abin Simon on meain/blog..gitconfig
includes,
by Garrit Franke on Garrit’s Notes blog.Git tools and sites
~/bin
directories, config files,
and the like. Written in Python.
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 Bruno Brito, Adam Johnson and Sven Strickroth.