<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/blob.c, 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>2023-12-26T20:04:31Z</updated>
<entry>
<title>treewide: remove unnecessary includes in source files</title>
<updated>2023-12-26T20:04:31Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-12-23T17:14:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eea0e59ffbed6e33d171ace5be13cde9faa41639'/>
<id>urn:sha1:eea0e59ffbed6e33d171ace5be13cde9faa41639</id>
<content type='text'>
Each of these were checked with
   gcc -E -I. ${SOURCE_FILE} | grep ${HEADER_FILE}
to ensure that removing the direct inclusion of the header actually
resulted in that header no longer being included at all (i.e. that
no other header pulled it in transitively).

...except for a few cases where we verified that although the header
was brought in transitively, nothing from it was directly used in
that source file.  These cases were:
  * builtin/credential-cache.c
  * builtin/pull.c
  * builtin/send-pack.c

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>object.h: stop depending on cache.h; make cache.h depend on object.h</title>
<updated>2023-02-24T01:25:29Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-02-24T00:09:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a64215b6cd5e67939187475c5b248dc5d13e3d60'/>
<id>urn:sha1:a64215b6cd5e67939187475c5b248dc5d13e3d60</id>
<content type='text'>
Things should be able to depend on object.h without pulling in all of
cache.h.  Move an enum to allow this.

Note that a couple files previously depended on things brought in
through cache.h indirectly (revision.h -&gt; commit.h -&gt; object.h -&gt;
cache.h).  As such, this change requires making existing dependencies
more explicit in half a dozen files.  The inclusion of strbuf.h in
some headers if of particular note: these headers directly embedded a
strbuf in some new structs, meaning they should have been including
strbuf.h all along but were indirectly getting the necessary
definitions.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<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>object: drop parsed_object_pool-&gt;commit_count</title>
<updated>2020-06-17T21:37:14Z</updated>
<author>
<name>Abhishek Kumar</name>
<email>abhishekkumar8222@gmail.com</email>
</author>
<published>2020-06-17T09:14:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6da43d937ca96d277556fa92c5a664fb1cbcc8ac'/>
<id>urn:sha1:6da43d937ca96d277556fa92c5a664fb1cbcc8ac</id>
<content type='text'>
14ba97f8 (alloc: allow arbitrary repositories for alloc functions,
2018-05-15) introduced parsed_object_pool-&gt;commit_count to keep count of
commits per repository and was used to assign commit-&gt;index.

However, commit-slab code requires commit-&gt;index values to be unique
and a global count would be correct, rather than a per-repo count.

Let's introduce a static counter variable, `parsed_commits_count` to
keep track of parsed commits so far.

As commit_count has no use anymore, let's also drop it from the struct.

Signed-off-by: Abhishek Kumar &lt;abhishekkumar8222@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>object: convert create_object() to use object_id</title>
<updated>2019-06-20T17:20:51Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-06-20T07:41:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a378509e1c8d817b3abe42bd8b3c8aa2a6f9af8a'/>
<id>urn:sha1:a378509e1c8d817b3abe42bd8b3c8aa2a6f9af8a</id>
<content type='text'>
There are no callers left of create_object() that aren't just passing us
the "hash" member of a "struct object_id". Let's take the whole struct,
which gets us closer to removing all raw sha1 variables.

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>object: convert lookup_object() to use object_id</title>
<updated>2019-06-20T17:18:09Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-06-20T07:41:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d0229abd93e1115d935b0e55067e29bcc9815ce8'/>
<id>urn:sha1:d0229abd93e1115d935b0e55067e29bcc9815ce8</id>
<content type='text'>
There are no callers left of lookup_object() that aren't just passing us
the "hash" member of a "struct object_id". Let's take the whole struct,
which gets us closer to removing all raw sha1 variables.  It also
matches the existing conversions of lookup_blob(), etc.

The conversions of callers were done by hand, but they're all mechanical
one-liners.

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>object: add repository argument to object_as_type</title>
<updated>2018-06-29T17:43:38Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-06-29T01:21:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1268dfac1e98e973c63abb142551c64bba6a44ca'/>
<id>urn:sha1:1268dfac1e98e973c63abb142551c64bba6a44ca</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>object: add repository argument to lookup_object</title>
<updated>2018-06-29T17:43:38Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-06-29T01:21:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5abddd1eb72ca47cc84a9fc888c30ebaadde2eec'/>
<id>urn:sha1:5abddd1eb72ca47cc84a9fc888c30ebaadde2eec</id>
<content type='text'>
Add a repository argument to allow callers of lookup_object to be more
specific about which repository to handle. 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: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
