<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/varint.c, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2025-10-02T16:32:32Z</updated>
<entry>
<title>varint: use explicit width for integers</title>
<updated>2025-10-02T16:32:32Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-10-02T07:29:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f366bfe16b350240c70c487d180c76ddcb8a1b2d'/>
<id>urn:sha1:f366bfe16b350240c70c487d180c76ddcb8a1b2d</id>
<content type='text'>
The varint subsystem currently uses implicit widths for integers. On the
one hand we use `uintmax_t` for the actual value. On the other hand, we
use `int` for the length of the encoded varint.

Both of these have known maximum values, as we only support at most 16
bytes when encoding varints. Thus, we know that we won't ever exceed
`uint64_t` for the actual value and `uint8_t` for the prefix length.

Refactor the code to use explicit widths. Besides making the logic
platform-independent, it also makes our life a bit easier in the next
commit, where we reimplement "varint.c" in Rust.

Suggested-by: Ezekiel Newren &lt;ezekielnewren@gmail.com&gt;
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>cleanups: ensure that git-compat-util.h is included first</title>
<updated>2014-09-15T19:05:14Z</updated>
<author>
<name>David Aguilar</name>
<email>davvid@gmail.com</email>
</author>
<published>2014-09-14T07:40:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1c4b6604126781361fe89d88ace70f53079fbab5'/>
<id>urn:sha1:1c4b6604126781361fe89d88ace70f53079fbab5</id>
<content type='text'>
CodingGuidelines states that the first #include in C files should be
git-compat-util.h or another header file that includes it, such as
cache.h or builtin.h.

Signed-off-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>varint: make it available outside the context of pack</title>
<updated>2012-04-03T23:24:44Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-04-03T22:53:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d2c1898571a6a2324593e92163e8754880e0c1fb'/>
<id>urn:sha1:d2c1898571a6a2324593e92163e8754880e0c1fb</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
