<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/commit-graph.c, branch v2.18.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.18.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.18.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-05-23T05:38:16Z</updated>
<entry>
<title>Merge branch 'sb/oid-object-info'</title>
<updated>2018-05-23T05:38:16Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-05-23T05:38:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fcb6df325468a7ae12949ab80dcd37772b9b1fbf'/>
<id>urn:sha1:fcb6df325468a7ae12949ab80dcd37772b9b1fbf</id>
<content type='text'>
The codepath around object-info API has been taught to take the
repository object (which in turn tells the API which object store
the objects are to be located).

* sb/oid-object-info:
  cache.h: allow oid_object_info to handle arbitrary repositories
  packfile: add repository argument to cache_or_unpack_entry
  packfile: add repository argument to unpack_entry
  packfile: add repository argument to read_object
  packfile: add repository argument to packed_object_info
  packfile: add repository argument to packed_to_object_type
  packfile: add repository argument to retry_bad_packed_offset
  cache.h: add repository argument to oid_object_info
  cache.h: add repository argument to oid_object_info_extended
</content>
</entry>
<entry>
<title>Merge branch 'ds/lazy-load-trees'</title>
<updated>2018-05-23T05:38:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-05-23T05:38:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c89b6e136e421f1e9108b3c5bc050b19b0243844'/>
<id>urn:sha1:c89b6e136e421f1e9108b3c5bc050b19b0243844</id>
<content type='text'>
The code has been taught to use the duplicated information stored
in the commit-graph file to learn the tree object name for a commit
to avoid opening and parsing the commit object when it makes sense
to do so.

* ds/lazy-load-trees:
  coccinelle: avoid wrong transformation suggestions from commit.cocci
  commit-graph: lazy-load trees for commits
  treewide: replace maybe_tree with accessor methods
  commit: create get_commit_tree() method
  treewide: rename tree to maybe_tree
</content>
</entry>
<entry>
<title>Merge branch 'ds/commit-graph'</title>
<updated>2018-05-08T06:59:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-05-08T06:59:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b10edb2df55241b2e042b3d5473537904d09d193'/>
<id>urn:sha1:b10edb2df55241b2e042b3d5473537904d09d193</id>
<content type='text'>
Precompute and store information necessary for ancestry traversal
in a separate file to optimize graph walking.

* ds/commit-graph:
  commit-graph: implement "--append" option
  commit-graph: build graph from starting commits
  commit-graph: read only from specific pack-indexes
  commit: integrate commit graph with commit parsing
  commit-graph: close under reachability
  commit-graph: add core.commitGraph setting
  commit-graph: implement git commit-graph read
  commit-graph: implement git-commit-graph write
  commit-graph: implement write_commit_graph()
  commit-graph: create git-commit-graph builtin
  graph: add commit graph design document
  commit-graph: add format document
  csum-file: refactor finalize_hashfile() method
  csum-file: rename hashclose() to finalize_hashfile()
</content>
</entry>
<entry>
<title>commit-graph: lazy-load trees for commits</title>
<updated>2018-04-11T01:47:16Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2018-04-06T19:09:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7b8a21dba1bce44d64bd86427d3d92437adc4707'/>
<id>urn:sha1:7b8a21dba1bce44d64bd86427d3d92437adc4707</id>
<content type='text'>
The commit-graph file provides quick access to commit data, including
the OID of the root tree for each commit in the graph. When performing
a deep commit-graph walk, we may not need to load most of the trees
for these commits.

Delay loading the tree object for a commit loaded from the graph
until requested via get_commit_tree(). Do not lazy-load trees for
commits not in the graph, since that requires duplicate parsing
and the relative peformance improvement when trees are not needed
is small.

On the Linux repository, performance tests were run for the following
command:

    git log --graph --oneline -1000

    Before: 0.92s
    After:  0.66s
    Rel %: -28.3%

Adding '-- kernel/' to the command requires loading the root tree
for every commit that is walked. There was no measureable performance
change as a result of this patch.

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>treewide: replace maybe_tree with accessor methods</title>
<updated>2018-04-11T01:47:16Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2018-04-06T19:09:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2e27bd7731d47b374c1c14b53af07b3bfa39fcac'/>
<id>urn:sha1:2e27bd7731d47b374c1c14b53af07b3bfa39fcac</id>
<content type='text'>
In anticipation of making trees load lazily, create a Coccinelle
script (contrib/coccinelle/commit.cocci) to ensure that all
references to the 'maybe_tree' member of struct commit are either
mutations or accesses through get_commit_tree() or
get_commit_tree_oid().

Apply the Coccinelle script to create the rest of the patch.

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>treewide: rename tree to maybe_tree</title>
<updated>2018-04-11T01:47:16Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2018-04-06T19:09:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=891435d55da80ca3654b19834481205be6bdfe33'/>
<id>urn:sha1:891435d55da80ca3654b19834481205be6bdfe33</id>
<content type='text'>
Using the commit-graph file to walk commit history removes the large
cost of parsing commits during the walk. This exposes a performance
issue: lookup_tree() takes a large portion of the computation time,
even when Git never uses those trees.

In anticipation of lazy-loading these trees, rename the 'tree' member
of struct commit to 'maybe_tree'. This serves two purposes: it hints
at the future role of possibly being NULL even if the commit has a
valid tree, and it allows for unambiguous transformation from simple
member access (i.e. commit-&gt;maybe_tree) to method access.

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit-graph: implement "--append" option</title>
<updated>2018-04-11T01:43:02Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2018-04-10T12:56:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7547b95b4fbb8591726b1d9381c176cc27fc6aea'/>
<id>urn:sha1:7547b95b4fbb8591726b1d9381c176cc27fc6aea</id>
<content type='text'>
Teach git-commit-graph to add all commits from the existing
commit-graph file to the file about to be written. This should be
used when adding new commits without performing garbage collection.

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit-graph: build graph from starting commits</title>
<updated>2018-04-11T01:43:02Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2018-04-10T12:56:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3d5df01b5e42416a59e857135e932bbdd8cc3ba0'/>
<id>urn:sha1:3d5df01b5e42416a59e857135e932bbdd8cc3ba0</id>
<content type='text'>
Teach git-commit-graph to read commits from stdin when the
--stdin-commits flag is specified. Commits reachable from these
commits are added to the graph. This is a much faster way to construct
the graph than inspecting all packed objects, but is restricted to
known tips.

For the Linux repository, 700,000+ commits were added to the graph
file starting from 'master' in 7-9 seconds, depending on the number
of packfiles in the repo (1, 24, or 120).

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit-graph: read only from specific pack-indexes</title>
<updated>2018-04-11T01:43:02Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2018-04-10T12:56:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=049d51a2bb9a03d2f2c2cce1ae41e57dbbf42244'/>
<id>urn:sha1:049d51a2bb9a03d2f2c2cce1ae41e57dbbf42244</id>
<content type='text'>
Teach git-commit-graph to inspect the objects only in a certain list
of pack-indexes within the given pack directory. This allows updating
the commit graph iteratively.

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit: integrate commit graph with commit parsing</title>
<updated>2018-04-11T01:43:02Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2018-04-10T12:56:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=177722b344256b84f1c97b7363d3f19c04928039'/>
<id>urn:sha1:177722b344256b84f1c97b7363d3f19c04928039</id>
<content type='text'>
Teach Git to inspect a commit graph file to supply the contents of a
struct commit when calling parse_commit_gently(). This implementation
satisfies all post-conditions on the struct commit, including loading
parents, the root tree, and the commit date.

If core.commitGraph is false, then do not check graph files.

In test script t5318-commit-graph.sh, add output-matching conditions on
read-only graph operations.

By loading commits from the graph instead of parsing commit buffers, we
save a lot of time on long commit walks. Here are some performance
results for a copy of the Linux repository where 'master' has 678,653
reachable commits and is behind 'origin/master' by 59,929 commits.

| Command                          | Before | After  | Rel % |
|----------------------------------|--------|--------|-------|
| log --oneline --topo-order -1000 |  8.31s |  0.94s | -88%  |
| branch -vv                       |  1.02s |  0.14s | -86%  |
| rev-list --all                   |  5.89s |  1.07s | -81%  |
| rev-list --all --objects         | 66.15s | 58.45s | -11%  |

Signed-off-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
