<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/commit.c, branch v2.22.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.22.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.22.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-07-29T19:38:22Z</updated>
<entry>
<title>Merge branch 'ds/close-object-store' into maint</title>
<updated>2019-07-29T19:38:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-07-29T19:38:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dea6737bb76ba231474668a804d3f7178b766c47'/>
<id>urn:sha1:dea6737bb76ba231474668a804d3f7178b766c47</id>
<content type='text'>
The commit-graph file is now part of the "files that the runtime
may keep open file descriptors on, all of which would need to be
closed when done with the object store", and the file descriptor to
an existing commit-graph file now is closed before "gc" finalizes a
new instance to replace it.

* ds/close-object-store:
  packfile: rename close_all_packs to close_object_store
  packfile: close commit-graph in close_all_packs
  commit-graph: use raw_object_store when closing
  commit-graph: extract write_commit_graph_file()
  commit-graph: extract copy_oids_to_commits()
  commit-graph: extract count_distinct_commits()
  commit-graph: extract fill_oids_from_all_packs()
  commit-graph: extract fill_oids_from_commit_hex()
  commit-graph: extract fill_oids_from_packs()
  commit-graph: create write_commit_graph_context
  commit-graph: remove Future Work section
  commit-graph: collapse parameters into flags
  commit-graph: return with errors during write
  commit-graph: fix the_repository reference
</content>
</entry>
<entry>
<title>commit-graph: fix the_repository reference</title>
<updated>2019-05-13T02:52:19Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2019-05-09T14:22:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c7944050af45c7384f97c712cb4d126672c7cfa6'/>
<id>urn:sha1:c7944050af45c7384f97c712cb4d126672c7cfa6</id>
<content type='text'>
The parse_commit_buffer() method takes a repository pointer, so it
should not refer to the_repository anymore.

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>Merge branch 'tb/unexpected'</title>
<updated>2019-05-08T15:37:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-05-08T15:37:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ea2dab1abbf14bfa7dd5299c9bb86d0f70aae019'/>
<id>urn:sha1:ea2dab1abbf14bfa7dd5299c9bb86d0f70aae019</id>
<content type='text'>
Code tightening against a "wrong" object appearing where an object
of a different type is expected, instead of blindly assuming that
the connection between objects are correctly made.

* tb/unexpected:
  rev-list: detect broken root trees
  rev-list: let traversal die when --missing is not in use
  get_commit_tree(): return NULL for broken tree
  list-objects.c: handle unexpected non-tree entries
  list-objects.c: handle unexpected non-blob entries
  t: introduce tests for unexpected object types
  t: move 'hex2oct' into test-lib-functions.sh
</content>
</entry>
<entry>
<title>commit.c: add repo_get_commit_tree()</title>
<updated>2019-04-16T09:56:51Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-04-16T09:33:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=301b8c7f405d3cd4f32b14bd336ac8c0400d9382'/>
<id>urn:sha1:301b8c7f405d3cd4f32b14bd336ac8c0400d9382</id>
<content type='text'>
Remove the implicit dependency on the_repository in this function.
It will be used in sha1-name.c functions when they are updated to take
any 'struct repository'. get_commit_tree() remains as a compat wrapper,
to be slowly replaced later.

Any access to "maybe_tree" field directly will result in _broken_ code
after running through commit.cocci because we can't know what is the
right repository to use.

the_repository would be correct most of the time. But we're relying less
and less on the_repository and that assumption may no longer be
true. The transformation now is more of a poor man replacement for a C++
compiler catching access to private fields.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit.cocci: refactor code, avoid double rewrite</title>
<updated>2019-04-16T09:56:51Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-04-16T09:33:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a133c40b23c80ed77cfe077213a45af67be28f74'/>
<id>urn:sha1:a133c40b23c80ed77cfe077213a45af67be28f74</id>
<content type='text'>
"maybe" pointer in 'struct commit' is tricky because it can be lazily
initialized to take advantage of commit-graph if available. This makes
it not safe to access directly.

This leads to a rule in commit.cocci to rewrite 'x-&gt;maybe_tree' to
'get_commit_tree(x)'. But that rule alone could lead to incorrectly
rewrite assignments, e.g. from

    x-&gt;maybe_tree = yes

to

    get_commit_tree(x) = yes

Because of this we have a second rule to revert this effect. Szeder
found out that we could do better by performing the assignment rewrite
rule first, then the remaining is read-only access and handled by the
current first rule.

For this to work, we need to transform "x-&gt;maybe_tree = y" to something
that does NOT contain "x-&gt;maybe_tree" to avoid the original first
rule. This is where set_commit_tree() comes in.

Helped-by: SZEDER Gábor &lt;szeder.dev@gmail.com&gt;
Helped-by: Johannes Schindelin &lt;Johannes.Schindelin@gmx.de&gt;
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>get_commit_tree(): return NULL for broken tree</title>
<updated>2019-04-10T03:59:39Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-04-10T02:13:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=834876630b21f832f648bc46a753291e4512ca8f'/>
<id>urn:sha1:834876630b21f832f648bc46a753291e4512ca8f</id>
<content type='text'>
Return NULL from 'get_commit_tree()' when a commit's root tree is
corrupt, doesn't exist, or points to an object which is not a tree.

In [1], this situation became a BUG(), but it can certainly occur in
cases which are not a bug in Git, for e.g., if a caller manually crafts
a commit whose tree is corrupt in any of the above ways.

Note that the expect_failure test in t6102 triggers this BUG(), but we
can't flip it to expect_success yet. Solving this problem actually
reveals a second bug.

[1]: 7b8a21dba1 (commit-graph: lazy-load trees for commits, 2018-04-06)

Co-authored-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sb/more-repo-in-api'</title>
<updated>2019-02-05T22:26:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-02-05T22:26:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b99a579f8e434a7757f90895945b5711b3f159d5'/>
<id>urn:sha1:b99a579f8e434a7757f90895945b5711b3f159d5</id>
<content type='text'>
The in-core repository instances are passed through more codepaths.

* sb/more-repo-in-api: (23 commits)
  t/helper/test-repository: celebrate independence from the_repository
  path.h: make REPO_GIT_PATH_FUNC repository agnostic
  commit: prepare free_commit_buffer and release_commit_memory for any repo
  commit-graph: convert remaining functions to handle any repo
  submodule: don't add submodule as odb for push
  submodule: use submodule repos for object lookup
  pretty: prepare format_commit_message to handle arbitrary repositories
  commit: prepare logmsg_reencode to handle arbitrary repositories
  commit: prepare repo_unuse_commit_buffer to handle any repo
  commit: prepare get_commit_buffer to handle any repo
  commit-reach: prepare in_merge_bases[_many] to handle any repo
  commit-reach: prepare get_merge_bases to handle any repo
  commit-reach.c: allow get_merge_bases_many_0 to handle any repo
  commit-reach.c: allow remove_redundant to handle any repo
  commit-reach.c: allow merge_bases_many to handle any repo
  commit-reach.c: allow paint_down_to_common to handle any repo
  commit: allow parse_commit* to handle any repo
  object: parse_object to honor its repository argument
  object-store: prepare has_{sha1, object}_file to handle any repo
  object-store: prepare read_object_file to deal with any repo
  ...
</content>
</entry>
<entry>
<title>commit: prepare free_commit_buffer and release_commit_memory for any repo</title>
<updated>2018-12-28T18:06:33Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-12-15T00:09:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6a7895fd8a3bd409f2b71ffc355d5142172cc2a0'/>
<id>urn:sha1:6a7895fd8a3bd409f2b71ffc355d5142172cc2a0</id>
<content type='text'>
Pass the object pool to free_commit_buffer and release_commit_memory,
such that we can eliminate access to 'the_repository'.

Also remove the TODO in release_commit_memory, as commit-&gt;util was
removed in 9d2c97016f (commit.h: delete 'util' field in struct commit,
2018-05-19)

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/verify-sig-merge-into-void'</title>
<updated>2018-11-18T09:23:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-11-18T09:23:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6d2035ee605980efa9915e10d35e7a355fc74077'/>
<id>urn:sha1:6d2035ee605980efa9915e10d35e7a355fc74077</id>
<content type='text'>
"git merge" and "git pull" that merges into an unborn branch used
to completely ignore "--verify-signatures", which has been
corrected.

* jk/verify-sig-merge-into-void:
  pull: handle --verify-signatures for unborn branch
  merge: handle --verify-signatures for unborn branch
  merge: extract verify_merge_signature() helper
</content>
</entry>
<entry>
<title>Merge branch 'ds/reachable-topo-order'</title>
<updated>2018-11-18T09:23:52Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-11-18T09:23:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=62ca33e02a4ea93dd59538ac986a082430253b27'/>
<id>urn:sha1:62ca33e02a4ea93dd59538ac986a082430253b27</id>
<content type='text'>
The revision walker machinery learned to take advantage of the
commit generation numbers stored in the commit-graph file.

* ds/reachable-topo-order:
  t6012: make rev-list tests more interesting
  revision.c: generation-based topo-order algorithm
  commit/revisions: bookkeeping before refactoring
  revision.c: begin refactoring --topo-order logic
  test-reach: add rev-list tests
  test-reach: add run_three_modes method
  prio-queue: add 'peek' operation
</content>
</entry>
</feed>
