<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/pack-objects.c, branch v2.2.1</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.2.1</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.2.1'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-10-29T17:07:56Z</updated>
<entry>
<title>Merge branch 'jk/prune-mtime'</title>
<updated>2014-10-29T17:07:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-10-29T17:07:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d70e331c0e8eaeb0bd75ae3020c3be71de075ff7'/>
<id>urn:sha1:d70e331c0e8eaeb0bd75ae3020c3be71de075ff7</id>
<content type='text'>
Tighten the logic to decide that an unreachable cruft is
sufficiently old by covering corner cases such as an ancient object
becoming reachable and then going unreachable again, in which case
its retention period should be prolonged.

* jk/prune-mtime: (28 commits)
  drop add_object_array_with_mode
  revision: remove definition of unused 'add_object' function
  pack-objects: double-check options before discarding objects
  repack: pack objects mentioned by the index
  pack-objects: use argv_array
  reachable: use revision machinery's --indexed-objects code
  rev-list: add --indexed-objects option
  rev-list: document --reflog option
  t5516: test pushing a tag of an otherwise unreferenced blob
  traverse_commit_list: support pending blobs/trees with paths
  make add_object_array_with_context interface more sane
  write_sha1_file: freshen existing objects
  pack-objects: match prune logic for discarding objects
  pack-objects: refactor unpack-unreachable expiration check
  prune: keep objects reachable from recent objects
  sha1_file: add for_each iterators for loose and packed objects
  count-objects: use for_each_loose_file_in_objdir
  count-objects: do not use xsize_t when counting object size
  prune-packed: use for_each_loose_file_in_objdir
  reachable: mark index blobs as SEEN
  ...
</content>
</entry>
<entry>
<title>Merge branch 'eb/no-pthreads'</title>
<updated>2014-10-24T21:59:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-10-24T21:59:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e4da4fbe0eea55c26f042f76df58bfc529b46ae0'/>
<id>urn:sha1:e4da4fbe0eea55c26f042f76df58bfc529b46ae0</id>
<content type='text'>
Allow us build with NO_PTHREADS=NoThanks compilation option.

* eb/no-pthreads:
  Handle atexit list internaly for unthreaded builds
  pack-objects: set number of threads before checking and warning
  index-pack: fix compilation with NO_PTHREADS
</content>
</entry>
<entry>
<title>Merge branch 'jk/pack-objects-no-bitmap-when-splitting'</title>
<updated>2014-10-24T21:56:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-10-24T21:56:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=26a22d8d00e288dd4825f5d5d77d47473bdf3a6b'/>
<id>urn:sha1:26a22d8d00e288dd4825f5d5d77d47473bdf3a6b</id>
<content type='text'>
Splitting pack-objects output into multiple packs is incompatible
with the use of reachability bitmap.

* jk/pack-objects-no-bitmap-when-splitting:
  pack-objects: turn off bitmaps when we split packs
</content>
</entry>
<entry>
<title>pack-objects: turn off bitmaps when we split packs</title>
<updated>2014-10-19T22:08:38Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-10-17T01:11:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=21134714787a02a37da15424d72c0119b2b8ed71'/>
<id>urn:sha1:21134714787a02a37da15424d72c0119b2b8ed71</id>
<content type='text'>
If a pack.packSizeLimit is set, we may split the pack data
across multiple packfiles. This means we cannot generate
.bitmap files, as they require that all of the reachable
objects are in the same pack. We check that condition when
we are generating the list of objects to pack (and disable
bitmaps if we are not packing everything), but we forgot to
update it when we notice that we needed to split (which
doesn't happen until the actual write phase).

The resulting bitmaps are quite bogus (they mention entries
that do not exist in the pack!) and can cause a fetch or
push to send insufficient objects.

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>pack-objects: double-check options before discarding objects</title>
<updated>2014-10-19T22:07:07Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-10-17T00:44:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b1e757f36377df1f2a6c165ebf171b09a8ad957b'/>
<id>urn:sha1:b1e757f36377df1f2a6c165ebf171b09a8ad957b</id>
<content type='text'>
When we are given an expiration time like
--unpack-unreachable=2.weeks.ago, we avoid writing out old,
unreachable loose objects entirely, under the assumption
that running "prune" would simply delete them immediately
anyway. However, this is only valid if we computed the same
set of reachable objects as prune would.

In practice, this is the case, because only git-repack uses
the --unpack-unreachable option with an expiration, and it
always feeds as many objects into the pack as possible. But
we can double-check at runtime just to be sure.

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>repack: pack objects mentioned by the index</title>
<updated>2014-10-19T22:07:07Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-10-17T00:44:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c90f9e13abae630551ada3e895633bdc2cf4e080'/>
<id>urn:sha1:c90f9e13abae630551ada3e895633bdc2cf4e080</id>
<content type='text'>
When we pack all objects, we use only the objects reachable
from references and reflogs. This misses any objects which
are reachable from the index, but not yet referenced.

By itself this isn't a big deal; the objects can remain
loose until they are actually used in a commit. However, it
does create a problem when we drop packed but unreachable
objects. We try to optimize out the writing of objects that
we will immediately prune, which means we must follow the
same rules as prune in determining what is reachable. And
prune uses the index for this purpose.

This is rather uncommon in practice, as objects in the index
would not usually have been packed in the first place. But
it could happen in a sequence like:

  1. You make a commit on a branch that references blob X.

  2. You repack, moving X into the pack.

  3. You delete the branch (and its reflog), so that X is
     unreferenced.

  4. You "git add" blob X so that it is now referenced only
     by the index.

  5. You repack again with git-gc. The pack-objects we
     invoke will see that X is neither referenced nor
     recent and not bother loosening it.

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>pack-objects: use argv_array</title>
<updated>2014-10-19T22:07:07Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-10-17T00:44:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=edfbb2aa538148b38ee0ba6d62c95b7edda5d817'/>
<id>urn:sha1:edfbb2aa538148b38ee0ba6d62c95b7edda5d817</id>
<content type='text'>
This saves us from having to bump the rp_av count when we
add new traversal options.

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>pack-objects: match prune logic for discarding objects</title>
<updated>2014-10-16T17:10:43Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-10-15T22:42:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=abcb86553d3ec4afffa4e3963089dffe0559740e'/>
<id>urn:sha1:abcb86553d3ec4afffa4e3963089dffe0559740e</id>
<content type='text'>
A recent commit taught git-prune to keep non-recent objects
that are reachable from recent ones. However, pack-objects,
when loosening unreachable objects, tries to optimize out
the write in the case that the object will be immediately
pruned. It now gets this wrong, since its rule does not
reflect the new prune code (and this can be seen by running
t6501 with a strategically placed repack).

Let's teach pack-objects similar logic.

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>pack-objects: refactor unpack-unreachable expiration check</title>
<updated>2014-10-16T17:10:42Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-10-15T22:41:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d0d46abc167d18fdbdbf2ece8ca6df704517c62f'/>
<id>urn:sha1:d0d46abc167d18fdbdbf2ece8ca6df704517c62f</id>
<content type='text'>
When we are loosening unreachable packed objects, we do not
bother to process objects that would simply be pruned
immediately anyway. The "would be pruned" check is a simple
comparison, but is about to get more complicated. Let's pull
it out into a separate function.

Note that this is slightly less efficient than the original,
which avoided even opening old packs, since no object in
them could pass the current check, which cares only about
the pack mtime.  But the new rules will depend on the exact
object, so we need to perform the check even for old packs.

Note also that we fix a minor buglet when the pack mtime is
exactly the same as the expiration time. The prune code
considers that worth pruning, whereas our check here
considered it worth keeping. This wasn't a big deal. Besides
being unlikely to happen, the result was simply that the
object was loosened and then pruned, missing the
optimization. Still, we can easily fix it while we are here.

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>pack-objects: set number of threads before checking and warning</title>
<updated>2014-10-13T19:53:46Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-10-13T19:46:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0c45d258ec35c1ef51523dd45e4518bd8a09258c'/>
<id>urn:sha1:0c45d258ec35c1ef51523dd45e4518bd8a09258c</id>
<content type='text'>
Under NO_PTHREADS build, we warn when delta_search_threads is not
set to 1, because that is the only sensible value on a single
threaded build.

However, the auto detection that kicks in when that variable is set
to 0 (e.g. there is no configuration variable or command line option,
or an explicit --threads=0 is given from the command line to override
the pack.threads configuration to force auto-detection) was not done
before the condition to issue this warning was tested.

Move the auto-detection code and place it at an appropriate spot.

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