<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/pack-objects.c, branch v1.8.2.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.8.2.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.8.2.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2012-10-25T10:42:27Z</updated>
<entry>
<title>Merge branch 'jk/peel-ref'</title>
<updated>2012-10-25T10:42:27Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-10-25T10:42:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=315ea32f1bd57b884f654f6f8a965af9b5e4d8ee'/>
<id>urn:sha1:315ea32f1bd57b884f654f6f8a965af9b5e4d8ee</id>
<content type='text'>
Speeds up "git upload-pack" (what is invoked by "git fetch" on the
other side of the connection) by reducing the cost to advertise the
branches and tags that are available in the repository.

* jk/peel-ref:
  upload-pack: use peel_ref for ref advertisements
  peel_ref: check object type before loading
  peel_ref: do not return a null sha1
  peel_ref: use faster deref_tag_noverify
</content>
</entry>
<entry>
<title>peel_ref: do not return a null sha1</title>
<updated>2012-10-05T03:34:28Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-10-04T08:00:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e6dbffa67b8e4c463a8fe18e8599b8623d7f0485'/>
<id>urn:sha1:e6dbffa67b8e4c463a8fe18e8599b8623d7f0485</id>
<content type='text'>
The idea of the peel_ref function is to dereference tag
objects recursively until we hit a non-tag, and return the
sha1. Conceptually, it should return 0 if it is successful
(and fill in the sha1), or -1 if there was nothing to peel.

However, the current behavior is much more confusing. For a
regular loose ref, the behavior is as described above. But
there is an optimization to reuse the peeled-ref value for a
ref that came from a packed-refs file. If we have such a
ref, we return its peeled value, even if that peeled value
is null (indicating that we know the ref definitely does
_not_ peel).

It might seem like such information is useful to the caller,
who would then know not to bother loading and trying to peel
the object. Except that they should not bother loading and
trying to peel the object _anyway_, because that fallback is
already handled by peel_ref. In other words, the whole point
of calling this function is that it handles those details
internally, and you either get a sha1, or you know that it
is not peel-able.

This patch catches the null sha1 case internally and
converts it into a -1 return value (i.e., there is nothing
to peel). This simplifies callers, which do not need to
bother checking themselves.

Two callers are worth noting:

  - in pack-objects, a comment indicates that there is a
    difference between non-peelable tags and unannotated
    tags. But that is not the case (before or after this
    patch). Whether you get a null sha1 has to do with
    internal details of how peel_ref operated.

  - in show-ref, if peel_ref returns a failure, the caller
    tries to decide whether to try peeling manually based on
    whether the REF_ISPACKED flag is set. But this doesn't
    make any sense. If the flag is set, that does not
    necessarily mean the ref came from a packed-refs file
    with the "peeled" extension. But it doesn't matter,
    because even if it didn't, there's no point in trying to
    peel it ourselves, as peel_ref would already have done
    so. In other words, the fallback peeling is guaranteed
    to fail.

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>i18n: pack-objects: mark parseopt strings for translation</title>
<updated>2012-08-20T19:23:18Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2012-08-20T12:32:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4c6881204b39a1065641f2b4f0ebbb77b9c6f3d7'/>
<id>urn:sha1:4c6881204b39a1065641f2b4f0ebbb77b9c6f3d7</id>
<content type='text'>
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>Merge branch 'jc/sha1-name-more'</title>
<updated>2012-07-22T19:55:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-07-22T19:55:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0958a24d7360759902f802744c0839c8029659d7'/>
<id>urn:sha1:0958a24d7360759902f802744c0839c8029659d7</id>
<content type='text'>
Teaches the object name parser things like a "git describe" output
is always a commit object, "A" in "git log A" must be a committish,
and "A" and "B" in "git log A...B" both must be committish, etc., to
prolong the lifetime of abbreviated object names.

* jc/sha1-name-more: (27 commits)
  t1512: match the "other" object names
  t1512: ignore whitespaces in wc -l output
  rev-parse --disambiguate=&lt;prefix&gt;
  rev-parse: A and B in "rev-parse A..B" refer to committish
  reset: the command takes committish
  commit-tree: the command wants a tree and commits
  apply: --build-fake-ancestor expects blobs
  sha1_name.c: add support for disambiguating other types
  revision.c: the "log" family, except for "show", takes committish
  revision.c: allow handle_revision_arg() to take other flags
  sha1_name.c: introduce get_sha1_committish()
  sha1_name.c: teach lookup context to get_sha1_with_context()
  sha1_name.c: many short names can only be committish
  sha1_name.c: get_sha1_1() takes lookup flags
  sha1_name.c: get_describe_name() by definition groks only commits
  sha1_name.c: teach get_short_sha1() a commit-only option
  sha1_name.c: allow get_short_sha1() to take other flags
  get_sha1(): fix error status regression
  sha1_name.c: restructure disambiguation of short names
  sha1_name.c: correct misnamed "canonical" and "res"
  ...
</content>
</entry>
<entry>
<title>revision.c: allow handle_revision_arg() to take other flags</title>
<updated>2012-07-09T23:42:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-07-02T19:33:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8e676e8ba567eccee1510b90ec2e0364dcc2f3b4'/>
<id>urn:sha1:8e676e8ba567eccee1510b90ec2e0364dcc2f3b4</id>
<content type='text'>
The existing "cant_be_filename" that tells the function that the
caller knows the arg is not a path (hence it does not have to be
checked for absense of the file whose name matches it) is made into
a bit in the flag word.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-objects: use streaming interface for reading large loose blobs</title>
<updated>2012-05-29T17:50:56Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2012-05-26T10:28:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cf2ba13ac6a7589fde5b7e888fedb2e7299e423a'/>
<id>urn:sha1:cf2ba13ac6a7589fde5b7e888fedb2e7299e423a</id>
<content type='text'>
git usually streams large blobs directly to packs. But there are cases
where git can create large loose blobs (unpack-objects or hash-object
over pipe). Or they can come from other git implementations.
core.bigfilethreshold can also be lowered down and introduce a new
wave of large loose blobs.

Use streaming interface to read/compress/write these blobs in one
go. Fall back to normal way if somehow streaming interface cannot be
used.

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>pack-objects: refactor write_object() into helper functions</title>
<updated>2012-05-18T21:22:15Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2012-05-16T12:02:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c9018b0305a56436c85b292edbeacff04b0ebb5d'/>
<id>urn:sha1:c9018b0305a56436c85b292edbeacff04b0ebb5d</id>
<content type='text'>
The function first decides if we want to copy data taken from existing
pack verbatim or we want to encode the data ourselves for the packfile
we are creating and then carries out the decision.  Separate the latter
phase into two helper functions, one for the case the data is reused,
the other for the case the data is produced anew.

A little twist is that it can later turn out that we cannot reuse the
data after we initially decide to do so; in such a case, the "reuse"
helper makes a call to "generate" helper.  It is easier to follow than
the current fallback code that uses "goto" inside a single large
function.

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>pack-objects, streaming: turn "xx &gt;= big_file_threshold" to ".. &gt; .."</title>
<updated>2012-05-18T21:21:19Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2012-05-16T12:02:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=754980d02386e09d0277d22284375686c197ddbd'/>
<id>urn:sha1:754980d02386e09d0277d22284375686c197ddbd</id>
<content type='text'>
This is because all other places do "xx &gt; big_file_threshold"

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>gc: do not explode objects which will be immediately pruned</title>
<updated>2012-04-11T18:09:49Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-04-07T10:30:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7e52f5660e542cf801e8fc6902a30cc572c13736'/>
<id>urn:sha1:7e52f5660e542cf801e8fc6902a30cc572c13736</id>
<content type='text'>
When we pack everything into one big pack with "git repack
-Ad", any unreferenced objects in to-be-deleted packs are
exploded into loose objects, with the intent that they will
be examined and possibly cleaned up by the next run of "git
prune".

Since the exploded objects will receive the mtime of the
pack from which they come, if the source pack is old, those
loose objects will end up pruned immediately. In that case,
it is much more efficient to skip the exploding step
entirely for these objects.

This patch teaches pack-objects to receive the expiration
information and avoid writing these objects out. It also
teaches "git gc" to pass the value of gc.pruneexpire to
repack (which in turn learns to pass it along to
pack-objects) so that this optimization happens
automatically during "git gc" and "git gc --auto".

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Acked-by: Nicolas Pitre &lt;nico@fluxnic.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack-objects: Fix compilation with NO_PTHREDS</title>
<updated>2012-02-27T01:46:00Z</updated>
<author>
<name>Michał Kiedrowicz</name>
<email>michal.kiedrowicz@gmail.com</email>
</author>
<published>2012-02-25T08:16:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2b34e486bc0ce1aabaa024ca97e8b005d9bc53ed'/>
<id>urn:sha1:2b34e486bc0ce1aabaa024ca97e8b005d9bc53ed</id>
<content type='text'>
It looks like commit 99fb6e04 (pack-objects: convert to use
parse_options(), 2012-02-01) moved the #ifdef NO_PTHREDS around but
hasn't noticed that the 'arg' variable no longer is available.

Signed-off-by: Michał Kiedrowicz &lt;michal.kiedrowicz@gmail.com&gt;
Acked-by: Nguyen Thai Ngoc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
