<feed xmlns='http://www.w3.org/2005/Atom'>
<title>pub/scm/git/git.git/commit.h, branch master</title>
<subtitle>Git source code mirror</subtitle>
<id>http://kernel.varnish.org/pub/scm/git/git.git/atom/commit.h?h=master</id>
<link rel='self' href='http://kernel.varnish.org/pub/scm/git/git.git/atom/commit.h?h=master'/>
<link rel='alternate' type='text/html' href='http://kernel.varnish.org/pub/scm/git/git.git/'/>
<updated>2026-06-16T16:01:02Z</updated>
<entry>
<title>Merge branch 'kk/streaming-walk-pqueue'</title>
<updated>2026-06-16T16:01:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-06-16T16:01:02Z</published>
<link rel='alternate' type='text/html' href='http://kernel.varnish.org/pub/scm/git/git.git/commit/?id=6e148f82dc91cf208c5f60dea66dce198d4ee4e2'/>
<id>urn:sha1:6e148f82dc91cf208c5f60dea66dce198d4ee4e2</id>
<content type='text'>
Streaming revision walks have been optimized by using a priority queue
for date-sorting commits, speeding up walks repositories with many
merges.

* kk/streaming-walk-pqueue:
  revision: use priority queue for non-limited streaming walks
  revision: introduce rev_walk_mode to clarify get_revision_1()
  pack-objects: call release_revisions() after cruft traversal
</content>
</entry>
<entry>
<title>commit: remove deprecated functions</title>
<updated>2026-05-28T20:11:03Z</updated>
<author>
<name>Kristoffer Haugsbakk</name>
<email>code@khaugsbakk.name</email>
</author>
<published>2026-05-28T07:00:11Z</published>
<link rel='alternate' type='text/html' href='http://kernel.varnish.org/pub/scm/git/git.git/commit/?id=83e7f3bd2bac934c21f39175b965c37810a41ea5'/>
<id>urn:sha1:83e7f3bd2bac934c21f39175b965c37810a41ea5</id>
<content type='text'>
These functions were deprecated in a series of commits merged in
52882024 (Merge branch 'ps/commit-list-functions-renamed', 2026-02-13).

The compatibility was for in-flight topics at the time.

Acked-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Kristoffer Haugsbakk &lt;code@khaugsbakk.name&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>revision: use priority queue for non-limited streaming walks</title>
<updated>2026-05-27T21:08:20Z</updated>
<author>
<name>Kristofer Karlsson</name>
<email>krka@spotify.com</email>
</author>
<published>2026-05-27T15:50:02Z</published>
<link rel='alternate' type='text/html' href='http://kernel.varnish.org/pub/scm/git/git.git/commit/?id=dd4bc01c0a8fc871a68a5027ed5ac953fa47fc6e'/>
<id>urn:sha1:dd4bc01c0a8fc871a68a5027ed5ac953fa47fc6e</id>
<content type='text'>
The streaming (non-limited) walk in get_revision_1() inserts newly
discovered parent commits into a date-sorted queue via
commit_list_insert_by_date(), which scans the linked list to find the
insertion point -- O(w) per insert, where w is the width of the active
walk frontier.  Replace this with an O(log w) priority queue.

Add a commit_queue field to rev_info alongside the existing commits
linked list.  The two representations are mutually exclusive: setup
and external callers that need list access use the linked list, then
get_revision_1() lazily drains it into the priority queue on first
call.  Add a REV_WALK_NO_WALK enum value to distinguish the no_walk
case (which still uses the commit list) from the streaming case.

The conversion function rev_info_commit_list_to_queue() is public so
callers that know they will iterate can convert early.

Combined with the limit_list() priority queue change already in
master, this eliminates all O(w) sorted linked-list insertion from
the revision walk machinery.

Signed-off-by: Kristofer Karlsson &lt;krka@spotify.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ps/history-split'</title>
<updated>2026-03-24T19:31:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-03-24T19:31:32Z</published>
<link rel='alternate' type='text/html' href='http://kernel.varnish.org/pub/scm/git/git.git/commit/?id=49e6a7cd63793459c397dd9e1d772c41f997067a'/>
<id>urn:sha1:49e6a7cd63793459c397dd9e1d772c41f997067a</id>
<content type='text'>
"git history" learned the "split" subcommand.

* ps/history-split:
  builtin/history: implement "split" subcommand
  builtin/history: split out extended function to create commits
  cache-tree: allow writing in-memory index as tree
  add-patch: allow disabling editing of hunks
  add-patch: add support for in-memory index patching
  add-patch: remove dependency on "add-interactive" subsystem
  add-patch: split out `struct interactive_options`
  add-patch: split out header from "add-interactive.h"
</content>
</entry>
<entry>
<title>commit: remove unused forward declaration</title>
<updated>2026-03-13T04:28:19Z</updated>
<author>
<name>Justin Tobler</name>
<email>jltobler@gmail.com</email>
</author>
<published>2026-03-13T01:39:36Z</published>
<link rel='alternate' type='text/html' href='http://kernel.varnish.org/pub/scm/git/git.git/commit/?id=233545cc60315863fea3fa17e2df86de23a6a4f7'/>
<id>urn:sha1:233545cc60315863fea3fa17e2df86de23a6a4f7</id>
<content type='text'>
In 6206089cbd (commit: write commits for both hashes, 2023-10-01),
`sign_with_header()` was removed, but its forward declaration in
"commit.h" was left. Remove the unused declaration.

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>add-patch: split out `struct interactive_options`</title>
<updated>2026-03-03T23:09:35Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-02T12:13:06Z</published>
<link rel='alternate' type='text/html' href='http://kernel.varnish.org/pub/scm/git/git.git/commit/?id=e3d4d7787cc3b2f0281e808042ceaa08e05c281b'/>
<id>urn:sha1:e3d4d7787cc3b2f0281e808042ceaa08e05c281b</id>
<content type='text'>
The `struct add_p_opt` is reused both by our infra for "git add -p" and
"git add -i". Users of `run_add_i()` for example are expected to pass
`struct add_p_opt`. This is somewhat confusing and raises the question
of which options apply to what part of the stack.

But things are even more confusing than that: while callers are expected
to pass in `struct add_p_opt`, these options ultimately get used to
initialize a `struct add_i_state` that is used by both subsystems. So we
are basically going full circle here.

Refactor the code and split out a new `struct interactive_options` that
hosts common options used by both. These options are then applied to a
`struct interactive_config` that hosts common configuration.

This refactoring doesn't yet fully detangle the two subsystems from one
another, as we still end up calling `init_add_i_state()` in the "git add
-p" subsystem. This will be fixed in a subsequent 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 '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://kernel.varnish.org/pub/scm/git/git.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: make `repo_parse_commit_no_graph()` more robust</title>
<updated>2026-02-19T17:34:26Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-02-16T15:38:02Z</published>
<link rel='alternate' type='text/html' href='http://kernel.varnish.org/pub/scm/git/git.git/commit/?id=024b4c96976fabdc8b73f4183d6bb8626ffe2c7d'/>
<id>urn:sha1:024b4c96976fabdc8b73f4183d6bb8626ffe2c7d</id>
<content type='text'>
In the next commit we will start to parse more commits via the
commit-graph. This change will lead to a segfault though because we try
to access the tree of a commit via `repo_get_commit_tree()`, but:

  - The commit has been parsed via the commit-graph, and thus its
    `maybe_tree` field is not yet populated.

  - We cannot use the commit-graph to populate the commit's tree because
    we're in the process of writing the commit-graph.

The consequence is that we'll get a `NULL` pointer for the tree in
`write_graph_chunk_data()`.

In theory we are already mindful of this situation, as we explicitly use
`repo_parse_commit_no_graph()` to parse the commit without the help of
the commit-graph. But that doesn't do the trick as the commit is already
marked as parsed, so the function will not re-populate it. And as the
commit-graph has been closed, neither will `get_commit_tree_oid()` be
able to load the tree for us.

It seems like this issue can only be hit under artificial circumstances:
the error was hit via `git_test_write_commit_graph_or_die()`, which is
run by git-commit(1) and git-merge(1) in case `GIT_TEST_COMMIT_GRAPH=1`:

  $ GIT_TEST_COMMIT_GRAPH=1 meson test t7507-commit-verbose \
      --test-args=-ix -i
  ...
  ++ git -c commit.verbose=true commit --amend
  hint: Waiting for your editor to close the file...
  ./test-lib.sh: line 1012: 55895 Segmentation fault         (core dumped) git -c commit.verbose=true commit --amend

To the best of my knowledge, this is the only case where we end up
writing a commit-graph in the same process that might have already
consulted the commit-graph to look up arbitrary objects. But regardless
of that, this feels like a bigger accident that is just waiting to
happen.

Make the code more robust by extending `repo_parse_commit_no_graph()` to
unparse a commit first in case we detect it's coming from a graph. This
ensures that we will re-read the object without it, and thus we will
populate `maybe_tree` properly.

This fix shouldn't have any performance consequences: the function is
only ever called in the "commit-graph.c" code, and we'll only re-parse
the commit at most once.

Add an exclusion to our Coccinelle rules so that it doesn't complain
about us accessing `maybe_tree` directly.

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: rename `free_commit_list()` to conform to coding guidelines</title>
<updated>2026-01-15T13:32:31Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-01-15T09:35:34Z</published>
<link rel='alternate' type='text/html' href='http://kernel.varnish.org/pub/scm/git/git.git/commit/?id=9f18d089c51fba2776fe1fece877a359c47417f7'/>
<id>urn:sha1:9f18d089c51fba2776fe1fece877a359c47417f7</id>
<content type='text'>
Our coding guidelines say that:

  Functions that operate on `struct S` are named `S_&lt;verb&gt;()` and should
  generally receive a pointer to `struct S` as first parameter.

While most of the functions related to `struct commit_list` already
follow that naming schema, `free_commit_list()` doesn't.

Rename the function to address this and adjust all of its callers. Add a
compatibility wrapper for the old function name to ease the transition
and avoid any semantic conflicts with in-flight patch series. This
wrapper will be removed once Git 2.53 has been released.

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: rename `reverse_commit_list()` to conform to coding guidelines</title>
<updated>2026-01-15T13:32:31Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-01-15T09:35:33Z</published>
<link rel='alternate' type='text/html' href='http://kernel.varnish.org/pub/scm/git/git.git/commit/?id=a468f3cefab32eed7d9a12bd6b93719d38ec67a6'/>
<id>urn:sha1:a468f3cefab32eed7d9a12bd6b93719d38ec67a6</id>
<content type='text'>
Our coding guidelines say that:

  Functions that operate on `struct S` are named `S_&lt;verb&gt;()` and should
  generally receive a pointer to `struct S` as first parameter.

While most of the functions related to `struct commit_list` already
follow that naming schema, `reverse_commit_list()` doesn't.

Rename the function to address this and adjust all of its callers. Add a
compatibility wrapper for the old function name to ease the transition
and avoid any semantic conflicts with in-flight patch series. This
wrapper will be removed once Git 2.53 has been released.

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