<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/commit.c, branch main</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=main</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2026-03-13T04:28:20Z</updated>
<entry>
<title>gpg-interface: allow sign_buffer() to use default signing key</title>
<updated>2026-03-13T04:28:20Z</updated>
<author>
<name>Justin Tobler</name>
<email>jltobler@gmail.com</email>
</author>
<published>2026-03-13T01:39:37Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=86ebf870b909a7f4707aa2601d290bc992d21a53'/>
<id>urn:sha1:86ebf870b909a7f4707aa2601d290bc992d21a53</id>
<content type='text'>
The `sign_commit_to_strbuf()` helper in "commit.c" provides fallback
logic to get the default configured signing key when a key is not
provided and handles generating the commit signature accordingly. This
signing operation is not really specific to commits as any arbitrary
buffer can be signed. Also, in a subsequent commit, this same logic is
reused by git-fast-import(1) when signing commits with invalid
signatures.

Remove the `sign_commit_to_strbuf()` helper from "commit.c" and extend
`sign_buffer()` in "gpg-interface.c" to support using the default key as
a fallback when the `SIGN_BUFFER_USE_DEFAULT_KEY` flag is provided. Call
sites are updated accordingly.

Signed-off-by: Justin Tobler &lt;jltobler@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ps/receive-pack-shallow-optim'</title>
<updated>2026-03-03T01:06:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-03-03T01:06:53Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=13763ecf7d92be72beff75c59163c5448d9e085e'/>
<id>urn:sha1:13763ecf7d92be72beff75c59163c5448d9e085e</id>
<content type='text'>
The code to accept shallow "git push" has been optimized.

* ps/receive-pack-shallow-optim:
  commit: use commit graph in `lookup_commit_reference_gently()`
  commit: make `repo_parse_commit_no_graph()` more robust
  commit: avoid parsing non-commits in `lookup_commit_reference_gently()`
</content>
</entry>
<entry>
<title>commit: use commit graph in `lookup_commit_reference_gently()`</title>
<updated>2026-02-19T17:34:26Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-02-16T15:38:03Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=bb5da75d6116c35924a04a418ef4c3182663d0a2'/>
<id>urn:sha1:bb5da75d6116c35924a04a418ef4c3182663d0a2</id>
<content type='text'>
In the preceding commit we refactored `lookup_commit_reference_gently()`
so that it doesn't parse non-commit objects anymore. This has led to a
speedup when git-receive-pack(1) accepts a shallow push into a repo
with lots of refs that point to blobs or trees.

But while this case is now faster, we still have the issue that
accepting pushes with lots of "normal" refs that point to commits are
still slow. This is mostly because we look up the commits via the object
database, and that is rather costly.

Adapt the code to use `repo_parse_commit_gently()` instead of
`parse_object()` to parse the resulting commit object. This function
knows to use the commit-graph to fill in the object, which is way more
cost efficient.

This leads to another significant speedup when accepting shallow pushes.
The following benchmark pushes a single objects from a shallow clone
into a repository with 600,000 references that all point to commits:

  Benchmark 1: git-receive-pack (rev = HEAD~)
    Time (mean ± σ):      9.179 s ±  0.031 s    [User: 8.858 s, System: 0.528 s]
    Range (min … max):    9.154 s …  9.213 s    3 runs

  Benchmark 2: git-receive-pack (rev = HEAD)
    Time (mean ± σ):      2.337 s ±  0.032 s    [User: 2.331 s, System: 0.234 s]
    Range (min … max):    2.308 s …  2.371 s    3 runs

  Summary
    git-receive-pack . &lt;/tmp/input (rev = HEAD) ran
      3.93 ± 0.05 times faster than git-receive-pack (rev = HEAD~)

Also, this again leads to a significant reduction in memory allocations.
Before this change:

  HEAP SUMMARY:
      in use at exit: 17,524,978 bytes in 22,393 blocks
    total heap usage: 33,313 allocs, 10,920 frees, 407,774,251 bytes allocated

And after this change:

  HEAP SUMMARY:
      in use at exit: 11,534,036 bytes in 12,406 blocks
    total heap usage: 13,284 allocs, 878 frees, 15,521,451 bytes allocated

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>commit: avoid parsing non-commits in `lookup_commit_reference_gently()`</title>
<updated>2026-02-19T17:34:16Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-02-16T15:38:01Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=f23ac77a4325fc776ebb38044a34f5e9629e4f67'/>
<id>urn:sha1:f23ac77a4325fc776ebb38044a34f5e9629e4f67</id>
<content type='text'>
The function `lookup_commit_reference_gently()` can be used to look up a
committish by object ID. As such, the function knows to peel for example
tag objects so that we eventually end up with the commit.

The function is used quite a lot throughout our tree. One such user is
"shallow.c" via `assign_shallow_commits_to_refs()`. The intent of this
function is to figure out whether a shallow push is missing any objects
that are required to satisfy the ref updates, and if so, which of the
ref updates is missing objects.

This is done by painting the tree with `UNINTERESTING`. We start
painting by calling `refs_for_each_ref()` so that we can mark all
existing referenced objects as the boundary of objects that we already
have, and which are supposed to be fully connected. The reference tips
are then parsed via `lookup_commit_reference_gently()`, and the commit
is then marked as uninteresting.

But references may not necessarily point to a committish, and if a lot
of them aren't then this step takes a lot of time. This is mostly due to
the way that `lookup_commit_reference_gently()` is implemented: before
we learn about the type of the object we already call `parse_object()`
on the object ID. This has two consequences:

  - We parse all objects, including trees and blobs, even though we
    don't even need the contents of them.

  - More importantly though, `parse_object()` will cause us to check
    whether the object ID matches its contents.

Combined this means that we deflate and hash every non-committish
object, and that of course ends up being both CPU- and memory-intensive.

Improve the logic so that we first use `peel_object()`. This function
won't parse the object for us, and thus it allows us to learn about the
object's type before we parse and return it.

The following benchmark pushes a single object from a shallow clone into
a repository that has 100,000 refs. These refs were created by listing
all objects via `git rev-list(1) --objects --all` and creating refs for
a subset of them, so lots of those refs will cover non-commit objects.

  Benchmark 1: git-receive-pack (rev = HEAD~)
    Time (mean ± σ):     62.571 s ±  0.413 s    [User: 58.331 s, System: 4.053 s]
    Range (min … max):   62.191 s … 63.010 s    3 runs

  Benchmark 2: git-receive-pack (rev = HEAD)
    Time (mean ± σ):     38.339 s ±  0.192 s    [User: 36.220 s, System: 1.992 s]
    Range (min … max):   38.176 s … 38.551 s    3 runs

  Summary
    git-receive-pack . &lt;/tmp/input (rev = HEAD) ran
      1.63 ± 0.01 times faster than git-receive-pack . &lt;/tmp/input (rev = HEAD~)

This leads to a sizeable speedup as we now skip reading and parsing
non-commit objects. Before this change we spent around 40% of the time
in `assign_shallow_commits_to_refs()`, after the change we only spend
around 1.2% of the time in there. Almost the entire remainder of the
time is spent in git-rev-list(1) to perform the connectivity checks.

Despite the speedup though, this also leads to a massive reduction in
allocations. Before:

  HEAP SUMMARY:
      in use at exit: 352,480,441 bytes in 97,185 blocks
    total heap usage: 2,793,820 allocs, 2,696,635 frees, 67,271,456,983 bytes allocated

And after:

  HEAP SUMMARY:
      in use at exit: 17,524,978 bytes in 22,393 blocks
    total heap usage: 33,313 allocs, 10,920 frees, 407,774,251 bytes allocated

Note that when all references refer to commits performance stays roughly
the same, as expected. The following benchmark was executed with 600k
commits:

  Benchmark 1: git-receive-pack (rev = HEAD~)
    Time (mean ± σ):      9.101 s ±  0.006 s    [User: 8.800 s, System: 0.520 s]
    Range (min … max):    9.095 s …  9.106 s    3 runs

  Benchmark 2: git-receive-pack (rev = HEAD)
    Time (mean ± σ):      9.128 s ±  0.094 s    [User: 8.820 s, System: 0.522 s]
    Range (min … max):    9.019 s …  9.188 s    3 runs

  Summary
    git-receive-pack (rev = HEAD~) ran
      1.00 ± 0.01 times faster than git-receive-pack (rev = HEAD)

This will be improved in the next commit.

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>Merge branch 'rs/commit-commit-stack'</title>
<updated>2026-02-17T21:30:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-02-17T21:30:42Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=83037cb3576393ef8abba34a2881e704fa42c7a8'/>
<id>urn:sha1:83037cb3576393ef8abba34a2881e704fa42c7a8</id>
<content type='text'>
Code clean-up to use the commit_stack API.

* rs/commit-commit-stack:
  commit: use commit_stack
</content>
</entry>
<entry>
<title>Merge branch 'rs/clean-includes'</title>
<updated>2026-02-17T21:30:42Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-02-17T21:30:42Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=354b8d89ac155fb3ae74575b23ee3b38451dfde6'/>
<id>urn:sha1:354b8d89ac155fb3ae74575b23ee3b38451dfde6</id>
<content type='text'>
Clean up redundant includes of header files.

* rs/clean-includes:
  remove duplicate includes
</content>
</entry>
<entry>
<title>Merge branch 'ps/commit-list-functions-renamed'</title>
<updated>2026-02-13T21:39:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-02-13T21:39:25Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=528820243334c55e015047477e720a14bc9cf25f'/>
<id>urn:sha1:528820243334c55e015047477e720a14bc9cf25f</id>
<content type='text'>
Rename three functions around the commit_list data structure.

* ps/commit-list-functions-renamed:
  commit: rename `free_commit_list()` to conform to coding guidelines
  commit: rename `reverse_commit_list()` to conform to coding guidelines
  commit: rename `copy_commit_list()` to conform to coding guidelines
</content>
</entry>
<entry>
<title>remove duplicate includes</title>
<updated>2026-02-08T23:03:06Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2026-02-08T12:32:22Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=10c68d2577b2c4eb4ca9b259a38a67444068e2d9'/>
<id>urn:sha1:10c68d2577b2c4eb4ca9b259a38a67444068e2d9</id>
<content type='text'>
The following command reports that some header files are included twice:

   $ git grep '#include' '*.c' | sort | uniq -cd

Remove the second #include line in each case, as it has no effect.

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>commit: use commit_stack</title>
<updated>2026-02-08T23:02:09Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2026-02-08T11:37:38Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=050566633ad0e168105687cdbdca36cd1add06d5'/>
<id>urn:sha1:050566633ad0e168105687cdbdca36cd1add06d5</id>
<content type='text'>
Use commit_stack instead of open-coding it.  Also convert the loop
counter i to size_t to match the type of the nr member of struct
commit_stack.

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>Revert "Merge branch 'ar/run-command-hook'"</title>
<updated>2026-01-15T21:02:38Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-01-15T19:12:53Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=a3d1f391d35762162356201028fb73774a6c4a8b'/>
<id>urn:sha1:a3d1f391d35762162356201028fb73774a6c4a8b</id>
<content type='text'>
This reverts commit f406b8955295d01089ba2baf35eceadff2d11cae,
reversing changes made to 1627809eeff75e6ec936fc609e7be46d5eb2fa9e.

It seems to have caused a few regressions, two of the three known
ones we have proposed solutions for.  Let's give ourselves a bit
more room to maneuver during the pre-release freeze period and
restart once the 2.53 ships.
</content>
</entry>
</feed>
