<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/tools, branch seen</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=seen</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=seen'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2026-05-18T05:29:04Z</updated>
<entry>
<title>Merge branch 'rs/strbuf-add-oid-hex' into seen</title>
<updated>2026-05-18T05:29:04Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-05-18T05:29:04Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=1795c27582d892439a7d33dbd304c6213b1d74be'/>
<id>urn:sha1:1795c27582d892439a7d33dbd304c6213b1d74be</id>
<content type='text'>
Formatting object name in full hexadecimal form has been optimized
by using a new strbuf_add_oid_hex() helper function.

Comments?

* rs/strbuf-add-oid-hex:
  hex: add and use strbuf_add_oid_hex()
</content>
</entry>
<entry>
<title>generate-configlist: collapse depfile for older Ninja</title>
<updated>2026-05-16T13:19:56Z</updated>
<author>
<name>Toon Claes</name>
<email>toon@iotcl.com</email>
</author>
<published>2026-05-15T08:42:26Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=088d9a1716c2b8cd31bf504371fd677fde1dddb1'/>
<id>urn:sha1:088d9a1716c2b8cd31bf504371fd677fde1dddb1</id>
<content type='text'>
The tools/generate-configlist.sh script generates two files:
  * config-list.h
  * config-list.h.d

The former is included by the source code and the latter defines on
which files the former depends.

The contents of `config-list.h.d` consists of two sections:

    config-list.h: Documentation/config.adoc
    config-list.h: Documentation/git-config.adoc
    config-list.h: Documentation/config/add.adoc
    config-list.h: Documentation/config/advice.adoc
    config-list.h: Documentation/config/alias.adoc
    config-list.h: Documentation/config/am.adoc
    config-list.h: Documentation/config/apply.adoc
    ...

This first section actually defines on which individual files
`config-list.h` depends and thus needs to be rebuild if one of those
changes.

And the second section contains content like:

    Documentation/config.adoc:
    Documentation/git-config.adoc:
    Documentation/config/add.adoc:
    Documentation/config/advice.adoc:
    Documentation/config/alias.adoc:
    Documentation/config/am.adoc:
    Documentation/config/apply.adoc:
    ...

These rules exist to ensure Make won't fail with the following error if
one of the .adoc files is renamed or removed:

   make: *** No rule to make target 'Documentation/config.adoc', needed by 'config-list.h'.

With the no-op targets defined in `config-list.h.d`, Make knows there's
no work to be done to generate these files, so it doesn't error out if
it doesn't exist.

For the Makefile build system this works great. And since
ebeea3c471 (build: regenerate config-list.h when Documentation changes,
2026-02-24) this script is also called from the Meson build system.
Nevertheless, on AlmaLinux 8 the following build failure is seen:

    ninja: error: dependency cycle: config-list.h -&gt; config-list.h

This version of this distro uses Ninja 1.8.2 and it seems to have some
issues with the format of the `config-list.h.d` file.

Ninja versions before 1.10.0 do not reset the depfile parser state on
newlines. This causes issues when the depfile has one dependency per
line, like we have in `config-list.h.d`:

    config-list.h: Documentation/config.adoc
    config-list.h: Documentation/config/add.adoc

The parser only recognizes the first "config-list.h:" as a target. On
subsequent lines it is still in dependency-parsing mode, so the repeated
output name is recorded as an input. This causes the error mentioned
above.

The bug in Ninja is fixed in 1.10, with commit
ninja-build/ninja@1daa7470ab7e (depfile_parser: remove restriction on
multiple outputs, 2019-11-20).

To be compatible with older versions of Ninja, collapse the dependencies
for `config-list.h` into a single line like:

    config-list.h: Documentation/config.adoc Documentation/config/add.adoc ...

This works around the bug in older versions of Ninja, and is fully
compatible Make and with more recent versions of Ninja. And while the
no-op targets are not needed for Ninja, they also don't do any harm.

Helped-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Toon Claes &lt;toon@iotcl.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>hex: add and use strbuf_add_oid_hex()</title>
<updated>2026-05-14T06:59:25Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2026-05-13T15:49:11Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=63621bcbba81a131794d510bcedfa08d9318219c'/>
<id>urn:sha1:63621bcbba81a131794d510bcedfa08d9318219c</id>
<content type='text'>
Add a function for adding the full hexadecimal hash value of an object
ID to a strbuf.  It's thread-safe and slightly more efficient than using
strbuf_addstr() with oid_to_hex() because it doesn't have to determine
the length of the string or copy it from the intermediate static buffer.

Add and apply a semantic patch to use it throughout the code base.

I get a tiny speedup for git log showing a single hash per commit:

Benchmark 1: ./git_main log --format=%H
  Time (mean ± σ):      91.2 ms ±   0.7 ms    [User: 51.9 ms, System: 38.6 ms]
  Range (min … max):    89.8 ms …  92.6 ms    31 runs

Benchmark 2: ./git log --format=%H
  Time (mean ± σ):      90.5 ms ±   0.7 ms    [User: 51.0 ms, System: 38.8 ms]
  Range (min … max):    89.2 ms …  92.3 ms    32 runs

Summary
  ./git log --format=%H ran
    1.01 ± 0.01 times faster than ./git_main log --format=%H

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rs/use-strvec-pushv'</title>
<updated>2026-04-01T17:28:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-04-01T17:28:18Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=51a74900aa48242db54336c0af43507acbe108ed'/>
<id>urn:sha1:51a74900aa48242db54336c0af43507acbe108ed</id>
<content type='text'>
Code paths that loop over another array to push each element into a
strvec have been rewritten to use strvec_pushv() instead.

* rs/use-strvec-pushv:
  use strvec_pushv() to add another strvec
</content>
</entry>
<entry>
<title>Merge branch 'jc/rerere-modern-strbuf-handling'</title>
<updated>2026-03-27T18:00:03Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-03-27T18:00:03Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=7241be412367d60c69b1eb7eb979be5935bed646'/>
<id>urn:sha1:7241be412367d60c69b1eb7eb979be5935bed646</id>
<content type='text'>
Code clean-up overdue by 19 years.

* jc/rerere-modern-strbuf-handling:
  cocci: strbuf.buf is never NULL
  rerere: update to modern representation of empty strbufs
</content>
</entry>
<entry>
<title>Merge branch 'ps/build-tweaks'</title>
<updated>2026-03-27T18:00:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-03-27T18:00:01Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=d1f07dd50087bef18246feffb963d73b23e2cdd6'/>
<id>urn:sha1:d1f07dd50087bef18246feffb963d73b23e2cdd6</id>
<content type='text'>
Tweak the build infrastructure by moving tools around.

* ps/build-tweaks:
  meson: precompile "git-compat-util.h"
  meson: compile compatibility sources separately
  git-compat-util.h: move warning infra to prepare for PCHs
  builds: move build scripts into "tools/"
  contrib: move "update-unicode.sh" script into "tools/"
  contrib: move "coverage-diff.sh" script into "tools/"
  contrib: move "coccinelle/" directory into "tools/"
  Introduce new "tools/" directory
</content>
</entry>
<entry>
<title>use strvec_pushv() to add another strvec</title>
<updated>2026-03-24T19:26:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-03-24T19:26:58Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=250e977a2b0aa8cc1c8063c64c44597a166e79f5'/>
<id>urn:sha1:250e977a2b0aa8cc1c8063c64c44597a166e79f5</id>
<content type='text'>
Add and apply a semantic patch that simplifies the code by letting
strvec_pushv() append the items of a second strvec instead of pushing
them one by one.

Suggested-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>meson: precompile "git-compat-util.h"</title>
<updated>2026-03-19T13:40:09Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-19T05:33:27Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=671df48df895fdf259b48a7f90b70b7c75fc4059'/>
<id>urn:sha1:671df48df895fdf259b48a7f90b70b7c75fc4059</id>
<content type='text'>
Every compilation unit in Git is expected to include "git-compat-util.h"
first, either directly or indirectly via "builtin.h". This header papers
over differences between platforms so that we can expect the typical
POSIX functions to exist. Furthermore, it provides functionality that we
end up using everywhere.

This header is thus quite heavy as a consequence. Preprocessing it as a
standalone unit via `clang -E git-compat-util.h` yields over 23,000
lines of code overall. Naturally, it takes quite some time to compile
all of this.

Luckily, this is exactly the kind of use case that precompiled headers
aim to solve: instead of recompiling it every single time, we compile it
once and then link the result into the executable. If include guards are
set up properly it means that the file won't need to be reprocessed.

Set up such a precompiled header for "git-compat-util.h" and wire it up
via Meson. This causes Meson to implicitly include the precompiled
header in all compilation units. With GCC and Clang for example this is
done via the "-include" statement [1].

This leads to a significant speedup when performing full builds:

  Benchmark 1: ninja (rev = HEAD~)
  Time (mean ± σ):     14.467 s ±  0.126 s    [User: 248.133 s, System: 31.298 s]
  Range (min … max):   14.195 s … 14.633 s    10 runs

  Benchmark 2: ninja (rev = HEAD)
    Time (mean ± σ):     10.307 s ±  0.111 s    [User: 173.290 s, System: 23.998 s]
    Range (min … max):   10.030 s … 10.433 s    10 runs

  Summary
    ninja (rev = HEAD) ran
      1.40 ± 0.02 times faster than ninja (rev = HEAD~)

[1]: https://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builds: move build scripts into "tools/"</title>
<updated>2026-03-19T13:40:09Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-19T05:33:24Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=a767f2fd6c5a6104ff32a35a27f0c15aec546957'/>
<id>urn:sha1:a767f2fd6c5a6104ff32a35a27f0c15aec546957</id>
<content type='text'>
We have a bunch of scripts used by our different build systems that are
all located in the top-level directory. Now that we have introduced the
new "tools/" directory though we have a better home for them.

Move the scripts into the "tools/" directory.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>contrib: move "update-unicode.sh" script into "tools/"</title>
<updated>2026-03-19T13:40:09Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-19T05:33:23Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=405c98a6a0e017f41f5de9c649a8f6f1b3fc4314'/>
<id>urn:sha1:405c98a6a0e017f41f5de9c649a8f6f1b3fc4314</id>
<content type='text'>
The "update-unicode.sh" script is used to update the unicode data
compiled into Git whenever a new version of the Unicode standard has
been released. As such, it is a natural part of our developer-facing
tooling, and its presence in "contrib/" is misleading.

Promote the script into the new "tools/" directory.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
