<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/blob.h, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-12-13T13:16:22Z</updated>
<entry>
<title>blob: drop unused parts of parse_blob_buffer()</title>
<updated>2022-12-13T13:16:22Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2022-12-13T11:11:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c1166ca0e23d60629e0e7babd4eb4be64f578286'/>
<id>urn:sha1:c1166ca0e23d60629e0e7babd4eb4be64f578286</id>
<content type='text'>
Our parse_blob_buffer() takes a ptr/len combo, just like
parse_tree_buffer(), etc, and returns success or failure. But it doesn't
actually do anything with them; we just set the "parsed" flag in the
object and return success, without even looking at the contents.

There could be some value to keeping these unused parameters:

  - it's consistent with the parse functions for other object types. But
    we already lost that consistency in 837d395a5c (Replace parse_blob()
    with an explanatory comment, 2010-01-18).

  - As the comment from 837d395a5c explains, callers are supposed to
    make sure they have the object content available. So in theory
    asking for these parameters could serve as a signal. But there are
    only two callers, and one of them always passes NULL (after doing a
    streaming check of the object hash).

    This shows that there aren't likely to be a lot of callers (since
    everyone either uses the type-generic parse functions, or handles
    blobs individually), and that they need to take special care anyway
    (because we usually want to avoid loading whole blobs in memory if
    we can avoid it).

So let's just drop these unused parameters, and likewise the useless
return value. While we're touching the header file, let's move the
declaration of parse_blob_buffer() right below that explanatory comment,
where it's more likely to be seen by people looking for the function.

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>blob: allow lookup_blob to handle arbitrary repositories</title>
<updated>2018-06-29T17:43:39Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-06-29T01:22:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=17126cdf78dc7b8cbe6b35bc44cb74d8d0fb11ee'/>
<id>urn:sha1:17126cdf78dc7b8cbe6b35bc44cb74d8d0fb11ee</id>
<content type='text'>
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>blob: add repository argument to lookup_blob</title>
<updated>2018-06-29T17:43:38Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-06-29T01:21:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=da14a7ff99e1d011192a1fe330dd3fddf8977dc3'/>
<id>urn:sha1:da14a7ff99e1d011192a1fe330dd3fddf8977dc3</id>
<content type='text'>
Add a repository argument to allow the callers of lookup_blob
to be more specific about which repository to act on. This is a small
mechanical change; it doesn't change the implementation to handle
repositories other than the_repository yet.

As with the previous commits, use a macro to catch callers passing a
repository other than the_repository at compile time.

Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
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>Convert lookup_blob to struct object_id</title>
<updated>2017-05-08T06:12:57Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2017-05-06T22:10:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3aca1fc6c9c69fbfce0e6312fc8e3087cb6334a4'/>
<id>urn:sha1:3aca1fc6c9c69fbfce0e6312fc8e3087cb6334a4</id>
<content type='text'>
Convert lookup_blob to take a pointer to struct object_id.

The commit was created with manual changes to blob.c and blob.h, plus
the following semantic patch:

@@
expression E1;
@@
- lookup_blob(E1.hash)
+ lookup_blob(&amp;E1)

@@
expression E1;
@@
- lookup_blob(E1-&gt;hash)
+ lookup_blob(E1)

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Replace parse_blob() with an explanatory comment</title>
<updated>2010-01-19T01:04:02Z</updated>
<author>
<name>Daniel Barkalow</name>
<email>barkalow@iabervon.org</email>
</author>
<published>2010-01-18T18:06:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=837d395a5c0b98ab938d71db8e2b6b9f69ddcc4d'/>
<id>urn:sha1:837d395a5c0b98ab938d71db8e2b6b9f69ddcc4d</id>
<content type='text'>
parse_blob() has never actually been used; it has served simply to
avoid having a confusing gap in the API. Instead of leaving it, put in
a comment that explains what "parsing a blob" entails (making sure the
object is actually readable), and why code might care whether a blob
has been parsed or not.

Signed-off-by: Daniel Barkalow &lt;barkalow@iabervon.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>[PATCH] Anal retentive 'const unsigned char *sha1'</title>
<updated>2005-06-08T20:04:53Z</updated>
<author>
<name>Jason McMullan</name>
<email>jason.mcmullan@timesys.com</email>
</author>
<published>2005-06-03T15:05:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5d6ccf5ce7f28e576a87f6c6f4f99fae90e06db6'/>
<id>urn:sha1:5d6ccf5ce7f28e576a87f6c6f4f99fae90e06db6</id>
<content type='text'>
Make 'sha1' parameters const where possible

Signed-off-by: Jason McMullan &lt;jason.mcmullan@timesys.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] don't load and decompress objects twice with parse_object()</title>
<updated>2005-05-06T18:02:01Z</updated>
<author>
<name>Nicolas Pitre</name>
<email>nico@cam.org</email>
</author>
<published>2005-05-06T17:48:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bd2c39f58f915af532b488c5bda753314f0db603'/>
<id>urn:sha1:bd2c39f58f915af532b488c5bda753314f0db603</id>
<content type='text'>
It turns out that parse_object() is loading and decompressing given
object to free it just before calling the specific object parsing
function which does mmap and decompress the same object again. This
patch introduces the ability to parse specific objects directly from a
memory buffer.

Without this patch, running git-fsck-cache on the kernel repositorytake:

	real    0m13.006s
	user    0m11.421s
	sys     0m1.218s

With this patch applied:

	real    0m8.060s
	user    0m7.071s
	sys     0m0.710s

The performance increase is significant, and this is kind of a
prerequisite for sane delta object support with fsck.

Signed-off-by: Nicolas Pitre &lt;nico@cam.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] Mark blobs as parsed when they're actually parsed</title>
<updated>2005-04-28T14:46:33Z</updated>
<author>
<name>Daniel Barkalow</name>
<email>barkalow@iabervon.org</email>
</author>
<published>2005-04-28T14:46:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a510bfaa8c001413f363e0d0b9c6cf15dbcbb7b3'/>
<id>urn:sha1:a510bfaa8c001413f363e0d0b9c6cf15dbcbb7b3</id>
<content type='text'>
This eliminates the special case for blobs versus other types of
objects. Now the scheme is entirely regular and I won't introduce stupid
bugs. (And fsck-cache doesn't have to do the do-nothing parse)

Signed-Off-By: Daniel Barkalow &lt;barkalow@iabervon.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] Header files for object parsing</title>
<updated>2005-04-18T18:39:48Z</updated>
<author>
<name>Daniel Barkalow</name>
<email>barkalow@iabervon.org</email>
</author>
<published>2005-04-18T18:39:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6eb8ae00d4bceaf660a07d8bc5ab8d6ddccbe1af'/>
<id>urn:sha1:6eb8ae00d4bceaf660a07d8bc5ab8d6ddccbe1af</id>
<content type='text'>
This adds the structs and function declarations for parsing git objects.

Signed-Off-By: Daniel Barkalow &lt;barkalow@iabervon.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
</feed>
