<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/commit-graph.c, branch v2.40.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.40.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.40.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2023-01-09T04:28:36Z</updated>
<entry>
<title>use DUP_ARRAY</title>
<updated>2023-01-09T04:28:36Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2023-01-01T21:16:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6e578410960d9ceb35ec98ad4b6fc711f1a9c85c'/>
<id>urn:sha1:6e578410960d9ceb35ec98ad4b6fc711f1a9c85c</id>
<content type='text'>
Add a semantic patch for replace ALLOC_ARRAY+COPY_ARRAY with DUP_ARRAY
to reduce code duplication and apply its results.

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>Merge branch 'ml/commit-graph-expire-dir-leak-fix'</title>
<updated>2022-09-21T21:23:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-09-21T21:23:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3239100b5a0135fb5d50a023fef7fdd7325f101a'/>
<id>urn:sha1:3239100b5a0135fb5d50a023fef7fdd7325f101a</id>
<content type='text'>
A result from opendir() was leaking in the commit-graph expiration
codepath, which has been plugged.

* ml/commit-graph-expire-dir-leak-fix:
  commit-graph: Fix missing closedir in expire_commit_graphs
</content>
</entry>
<entry>
<title>commit-graph: Fix missing closedir in expire_commit_graphs</title>
<updated>2022-09-19T17:42:38Z</updated>
<author>
<name>Miaoqian Lin</name>
<email>linmq006@gmail.com</email>
</author>
<published>2022-09-19T14:14:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=12f1ae53243d3ff06a956da1846dde6f32498342'/>
<id>urn:sha1:12f1ae53243d3ff06a956da1846dde6f32498342</id>
<content type='text'>
The function calls opendir() but missing the corresponding
closedir() before exit the function.
Add missing closedir() to fix it.

Signed-off-by: Miaoqian Lin &lt;linmq006@gmail.com&gt;
Reviewed-by: Derrick Stolee &lt;derrickstolee@github.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ab/unused-annotation'</title>
<updated>2022-09-14T19:56:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-09-14T19:56:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dd407f1c7c7cce148d7313537494d0bc049ccb0e'/>
<id>urn:sha1:dd407f1c7c7cce148d7313537494d0bc049ccb0e</id>
<content type='text'>
Undoes 'jk/unused-annotation' topic and redoes it to work around
Coccinelle rules misfiring false positives in unrelated codepaths.

* ab/unused-annotation:
  git-compat-util.h: use "deprecated" for UNUSED variables
  git-compat-util.h: use "UNUSED", not "UNUSED(var)"
</content>
</entry>
<entry>
<title>Merge branch 'jk/unused-annotation'</title>
<updated>2022-09-14T19:56:39Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-09-14T19:56:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a6b42ec0c6e2ef492b0ed6d1f1123dc7e724154e'/>
<id>urn:sha1:a6b42ec0c6e2ef492b0ed6d1f1123dc7e724154e</id>
<content type='text'>
Annotate function parameters that are not used (but cannot be
removed for structural reasons), to prepare us to later compile
with -Wunused warning turned on.

* jk/unused-annotation:
  is_path_owned_by_current_uid(): mark "report" parameter as unused
  run-command: mark unused async callback parameters
  mark unused read_tree_recursive() callback parameters
  hashmap: mark unused callback parameters
  config: mark unused callback parameters
  streaming: mark unused virtual method parameters
  transport: mark bundle transport_options as unused
  refs: mark unused virtual method parameters
  refs: mark unused reflog callback parameters
  refs: mark unused each_ref_fn parameters
  git-compat-util: add UNUSED macro
</content>
</entry>
<entry>
<title>Merge branch 'jk/rev-list-verify-objects-fix'</title>
<updated>2022-09-13T18:38:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-09-13T18:38:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=655e49404792a302b16fa640e1fa6041052996f9'/>
<id>urn:sha1:655e49404792a302b16fa640e1fa6041052996f9</id>
<content type='text'>
"git rev-list --verify-objects" ought to inspect the contents of
objects and notice corrupted ones, but it didn't when the commit
graph is in use, which has been corrected.

* jk/rev-list-verify-objects-fix:
  rev-list: disable commit graph with --verify-objects
  lookup_commit_in_graph(): use prepare_commit_graph() to check for graph
</content>
</entry>
<entry>
<title>lookup_commit_in_graph(): use prepare_commit_graph() to check for graph</title>
<updated>2022-09-07T16:44:28Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2022-09-06T21:02:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d6045294a9099af7d0f793cba557ce59d900bf3d'/>
<id>urn:sha1:d6045294a9099af7d0f793cba557ce59d900bf3d</id>
<content type='text'>
We exit early from lookup_commit_in_graph() if the commit_graph pointer
is NULL, under the assumption that we don't have a graph to look at. But
the graph pointer is lazy-loaded; if no other code happens to have
called prepare_commit_graph(), we'll incorrectly assume that one isn't
available at all.

This has a pretty small performance impact in practice, because the
fallback will generally be to call parse_object() instead. That ends up
in parse_commit_buffer(), which loads the graph data itself. So the
first commit we see won't use the graph, but subsequent ones will. Since
using the graph is just an optimization there's generally no
user-visible difference, but if you instrument rev-list like so:

  diff --git a/revision.c b/revision.c
  index ee702e498a..63c488ffb6 100644
  --- a/revision.c
  +++ b/revision.c
  @@ -381,6 +381,9 @@ static struct object *get_reference(struct rev_info *revs, const char *name,
           * parsing commit data from disk.
           */
          commit = lookup_commit_in_graph(revs-&gt;repo, oid);
  +       warning("%s %s in commit graph",
  +               commit ? "found" : "did not find",
  +               name);
          if (commit)
                  object = &amp;commit-&gt;object;
          else

and run (in git.git):

  git commit-graph write --reachable
  git rev-list origin/master origin/next &gt;/dev/null

you'll see that we fail to find the first one:

  warning: did not find origin/master in commit graph
  warning: found origin/next in commit graph

After this patch, you'll see that we find both:

  warning: found origin/master in commit graph
  warning: found origin/next in commit graph

Even though the performance implication is small here, there are two
important reasons to do this:

  - it's downright confusing if you are hunting a bug triggered by the
    use of the commit graph. It may or may not trigger depending on the
    number and ordering of tips you ask for.

  - prepare_commit_graph() has other policy logic, too. In particular,
    if we've loaded a commit graph and then disabled the graph via
    disable_commit_graph(), that should take precedence.

    I'm not sure if this can trigger bad behavior in practice. The only
    caller there is upload-pack's deepen_by_rev_list(), which should be
    avoiding the commit graph for its traversal tips, but probably
    wasn't before this patch. Whether you could come up with a case
    where that mattered is unclear. Still, this is obviously the right
    thing to be doing.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Reviewed-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-compat-util.h: use "UNUSED", not "UNUSED(var)"</title>
<updated>2022-09-01T17:49:48Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-08-25T17:09:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5cf88fd8b059235b21ee2f72b17bf1f421a9c4e7'/>
<id>urn:sha1:5cf88fd8b059235b21ee2f72b17bf1f421a9c4e7</id>
<content type='text'>
As reported in [1] the "UNUSED(var)" macro introduced in
2174b8c75de (Merge branch 'jk/unused-annotation' into next,
2022-08-24) breaks coccinelle's parsing of our sources in files where
it occurs.

Let's instead partially go with the approach suggested in [2] of
making this not take an argument. As noted in [1] "coccinelle" will
ignore such tokens in argument lists that it doesn't know about, and
it's less of a surprise to syntax highlighters.

This undoes the "help us notice when a parameter marked as unused is
actually use" part of 9b240347543 (git-compat-util: add UNUSED macro,
2022-08-19), a subsequent commit will further tweak the macro to
implement a replacement for that functionality.

1. https://lore.kernel.org/git/220825.86ilmg4mil.gmgdl@evledraar.gmail.com/
2. https://lore.kernel.org/git/220819.868rnk54ju.gmgdl@evledraar.gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: mark unused each_ref_fn parameters</title>
<updated>2022-08-19T19:18:54Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2022-08-19T10:08:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=63e14ee2d69b58eae72e34df81f2cde145427037'/>
<id>urn:sha1:63e14ee2d69b58eae72e34df81f2cde145427037</id>
<content type='text'>
Functions used with for_each_ref(), etc, need to conform to the
each_ref_fn interface. But most of them don't need every parameter;
let's annotate the unused ones to quiet -Wunused-parameter.

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 'tb/commit-graph-genv2-upgrade-fix' into maint</title>
<updated>2022-08-11T04:52:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-08-11T04:52:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=042159a5093db5da1be2a90b7c1b88441ece6029'/>
<id>urn:sha1:042159a5093db5da1be2a90b7c1b88441ece6029</id>
<content type='text'>
There was a bug in the codepath to upgrade generation information
in commit-graph from v1 to v2 format, which has been corrected.
source: &lt;cover.1657667404.git.me@ttaylorr.com&gt;

* tb/commit-graph-genv2-upgrade-fix:
  commit-graph: fix corrupt upgrade from generation v1 to v2
  commit-graph: introduce `repo_find_commit_pos_in_graph()`
  t5318: demonstrate commit-graph generation v2 corruption
</content>
</entry>
</feed>
