<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/pack-objects.c, branch v2.20.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.20.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.20.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-11-21T11:39:02Z</updated>
<entry>
<title>Merge branch 'cc/delta-islands'</title>
<updated>2018-11-21T11:39:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-11-21T11:39:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7fab474656cdb5517d5b627602a54776e485ddbc'/>
<id>urn:sha1:7fab474656cdb5517d5b627602a54776e485ddbc</id>
<content type='text'>
A few issues in the implementation of "delta-islands" feature has
been corrected.

* cc/delta-islands:
  pack-objects: fix off-by-one in delta-island tree-depth computation
  pack-objects: zero-initialize tree_depth/layer arrays
  pack-objects: fix tree_depth and layer invariants
</content>
</entry>
<entry>
<title>pack-objects: fix off-by-one in delta-island tree-depth computation</title>
<updated>2018-11-21T04:50:28Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-11-20T09:50:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3949053617652693b659a933a1393f8be189f26a'/>
<id>urn:sha1:3949053617652693b659a933a1393f8be189f26a</id>
<content type='text'>
When delta-islands are in use, we need to record the deepest path at
which we find each tree and blob. Our loop to do so counts slashes, so
"foo" is depth 0, "foo/bar" is depth 1, and so on.

However, this neglects root trees, which are represented by the empty
string. Those also have depth 0, but are at a layer above "foo". Thus,
"foo" should be 1, "foo/bar" at 2, and so on. We use this depth to
topo-sort the trees in resolve_tree_islands(). As a result, we may fail
to visit a root tree before the sub-trees it contains, and therefore not
correctly pass down the island marks.

That in turn could lead to missing some delta opportunities (objects are
in the same island, but we didn't realize it) or creating unwanted
cross-island deltas (one object is in an island another isn't, but we
don't realize). In practice, it seems to have only a small effect.  Some
experiments on the real-world git/git fork network at GitHub showed an
improvement of only 0.14% in the resulting clone size.

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/print-size-t-with-uintmax-format'</title>
<updated>2018-11-19T07:24:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-11-19T07:24:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f5f0f68d61301c3ffb2f8da84f627547e8f9a94c'/>
<id>urn:sha1:f5f0f68d61301c3ffb2f8da84f627547e8f9a94c</id>
<content type='text'>
Code preparation to replace ulong vars with size_t vars where
appropriate.

* tb/print-size-t-with-uintmax-format:
  Upcast size_t variables to uintmax_t when printing
</content>
</entry>
<entry>
<title>Merge branch 'ds/push-squelch-ambig-warning'</title>
<updated>2018-11-19T07:24:40Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-11-19T07:24:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=137399934da84ff8258c5ae8522006b5c1674eec'/>
<id>urn:sha1:137399934da84ff8258c5ae8522006b5c1674eec</id>
<content type='text'>
"git push" used to check ambiguities between object-names and
refnames while processing the list of refs' old and new values,
which was unnecessary (as it knew that it is feeding raw object
names).  This has been optimized out.

* ds/push-squelch-ambig-warning:
  pack-objects: ignore ambiguous object warnings
</content>
</entry>
<entry>
<title>Merge branch 'jk/unused-parameter-fixes'</title>
<updated>2018-11-18T09:23:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-11-18T09:23:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ab96f28ba4deb71ff64b31bd63cee96314db7112'/>
<id>urn:sha1:ab96f28ba4deb71ff64b31bd63cee96314db7112</id>
<content type='text'>
Various functions have been audited for "-Wunused-parameter" warnings
and bugs in them got fixed.

* jk/unused-parameter-fixes:
  midx: double-check large object write loop
  assert NOARG/NONEG behavior of parse-options callbacks
  parse-options: drop OPT_DATE()
  apply: return -1 from option callback instead of calling exit(1)
  cat-file: report an error on multiple --batch options
  tag: mark "--message" option with NONEG
  show-branch: mark --reflog option as NONEG
  format-patch: mark "--no-numbered" option with NONEG
  status: mark --find-renames option with NONEG
  cat-file: mark batch options with NONEG
  pack-objects: mark index-version option as NONEG
  ls-files: mark exclude options as NONEG
  am: handle --no-patch-format option
  apply: mark include/exclude options as NONEG
</content>
</entry>
<entry>
<title>Merge branch 'nd/pthreads'</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=26b80a841ad6f2ddff855aa9bd0000a4ba81f6ff'/>
<id>urn:sha1:26b80a841ad6f2ddff855aa9bd0000a4ba81f6ff</id>
<content type='text'>
The codebase has been cleaned up to reduce "#ifndef NO_PTHREADS".

* nd/pthreads:
  Clean up pthread_create() error handling
  read-cache.c: initialize copy_len to shut up gcc 8
  read-cache.c: reduce branching based on HAVE_THREADS
  read-cache.c: remove #ifdef NO_PTHREADS
  pack-objects: remove #ifdef NO_PTHREADS
  preload-index.c: remove #ifdef NO_PTHREADS
  grep: clean up num_threads handling
  grep: remove #ifdef NO_PTHREADS
  attr.c: remove #ifdef NO_PTHREADS
  name-hash.c: remove #ifdef NO_PTHREADS
  index-pack: remove #ifdef NO_PTHREADS
  send-pack.c: move async's #ifdef NO_PTHREADS back to run-command.c
  run-command.h: include thread-utils.h instead of pthread.h
  thread-utils: macros to unconditionally compile pthreads API
</content>
</entry>
<entry>
<title>Upcast size_t variables to uintmax_t when printing</title>
<updated>2018-11-12T07:43:52Z</updated>
<author>
<name>Torsten Bögershausen</name>
<email>tboegi@web.de</email>
</author>
<published>2018-11-11T07:05:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca473cef9140f55d68d6758fe226ef47c216669c'/>
<id>urn:sha1:ca473cef9140f55d68d6758fe226ef47c216669c</id>
<content type='text'>
When printing variables which contain a size, today "unsigned long"
is used at many places.
In order to be able to change the type from "unsigned long" into size_t
some day in the future, we need to have a way to print 64 bit variables
on a system that has "unsigned long" defined to be 32 bit, like Win64.

Upcast all those variables into uintmax_t before they are printed.
This is to prepare for a bigger change, when "unsigned long"
will be converted into size_t for variables which may be &gt; 4Gib.

Signed-off-by: Torsten Bögershausen &lt;tboegi@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-objects: ignore ambiguous object warnings</title>
<updated>2018-11-07T01:49:58Z</updated>
<author>
<name>Derrick Stolee</name>
<email>dstolee@microsoft.com</email>
</author>
<published>2018-11-06T20:34:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a4544b311eab7c3ffd2aa96deb9be0b92df05ae2'/>
<id>urn:sha1:a4544b311eab7c3ffd2aa96deb9be0b92df05ae2</id>
<content type='text'>
A git push process runs several processes during its run, but one
includes git send-pack which calls git pack-objects and passes
the known have/wants into stdin using object ids. However, the
default setting for core.warnAmbiguousRefs requires git pack-objects
to check for ref names matching the ref_rev_parse_rules array in
refs.c. This means that every object is triggering at least six
"file exists?" queries.  When there are a lot of refs, this can
add up significantly! I observed a simple push spending three
seconds checking these paths.

The fix here is similar to 4c30d50 "rev-list: disable object/refname
ambiguity check with --stdin".  While the get_object_list() method
reads the objects from stdin, turn warn_on_object_refname_ambiguity
flag (which is usually true) to false.  Just for code hygiene, save
away the original at the beginning and restore it once we are done.

Helped-by: Jeff King &lt;peff@peff.net&gt;
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 'md/exclude-promisor-objects-fix'</title>
<updated>2018-11-06T06:50:21Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-11-06T06:50:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a29b8bcf624006cf66abe129c01c932ec75df9f7'/>
<id>urn:sha1:a29b8bcf624006cf66abe129c01c932ec75df9f7</id>
<content type='text'>
Operations on promisor objects make sense in the context of only a
small subset of the commands that internally use the revisions
machinery, but the "--exclude-promisor-objects" option were taken
and led to nonsense results by commands like "log", to which it
didn't make much sense.  This has been corrected.

* md/exclude-promisor-objects-fix:
  exclude-promisor-objects: declare when option is allowed
  Documentation/git-log.txt: do not show --exclude-promisor-objects
</content>
</entry>
<entry>
<title>assert NOARG/NONEG behavior of parse-options callbacks</title>
<updated>2018-11-06T03:56:29Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-11-05T06:45:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=517fe807d6903c629a739b23fe0e75b892096998'/>
<id>urn:sha1:517fe807d6903c629a739b23fe0e75b892096998</id>
<content type='text'>
When we define a parse-options callback, the flags we put in the option
struct must match what the callback expects. For example, a callback
which does not handle the "unset" parameter should only be used with
PARSE_OPT_NONEG. But since the callback and the option struct are not
defined next to each other, it's easy to get this wrong (as earlier
patches in this series show).

Fortunately, the compiler can help us here: compiling with
-Wunused-parameters can show us which callbacks ignore their "unset"
parameters (and likewise, ones that ignore "arg" expect to be triggered
with PARSE_OPT_NOARG).

But after we've inspected a callback and determined that all of its
callers use the right flags, what do we do next? We'd like to silence
the compiler warning, but do so in a way that will catch any wrong calls
in the future.

We can do that by actually checking those variables and asserting that
they match our expectations. Because this is such a common pattern,
we'll introduce some helper macros. The resulting messages aren't
as descriptive as we could make them, but the file/line information from
BUG() is enough to identify the problem (and anyway, the point is that
these should never be seen).

Each of the annotated callbacks in this patch triggers
-Wunused-parameters, and was manually inspected to make sure all callers
use the correct options (so none of these BUGs should be triggerable).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
