<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/http-walker.c, branch v2.18.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.18.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.18.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-04-11T04:09:55Z</updated>
<entry>
<title>Merge branch 'sb/object-store'</title>
<updated>2018-04-11T04:09:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-04-11T04:09:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cf0b1793ead9428d88e6592e624c7cb222913c58'/>
<id>urn:sha1:cf0b1793ead9428d88e6592e624c7cb222913c58</id>
<content type='text'>
Refactoring the internal global data structure to make it possible
to open multiple repositories, work with and then close them.

Rerolled by Duy on top of a separate preliminary clean-up topic.
The resulting structure of the topics looked very sensible.

* sb/object-store: (27 commits)
  sha1_file: allow sha1_loose_object_info to handle arbitrary repositories
  sha1_file: allow map_sha1_file to handle arbitrary repositories
  sha1_file: allow map_sha1_file_1 to handle arbitrary repositories
  sha1_file: allow open_sha1_file to handle arbitrary repositories
  sha1_file: allow stat_sha1_file to handle arbitrary repositories
  sha1_file: allow sha1_file_name to handle arbitrary repositories
  sha1_file: add repository argument to sha1_loose_object_info
  sha1_file: add repository argument to map_sha1_file
  sha1_file: add repository argument to map_sha1_file_1
  sha1_file: add repository argument to open_sha1_file
  sha1_file: add repository argument to stat_sha1_file
  sha1_file: add repository argument to sha1_file_name
  sha1_file: allow prepare_alt_odb to handle arbitrary repositories
  sha1_file: allow link_alt_odb_entries to handle arbitrary repositories
  sha1_file: add repository argument to prepare_alt_odb
  sha1_file: add repository argument to link_alt_odb_entries
  sha1_file: add repository argument to read_info_alternates
  sha1_file: add repository argument to link_alt_odb_entry
  sha1_file: add raw_object_store argument to alt_odb_usable
  pack: move approximate object count to object store
  ...
</content>
</entry>
<entry>
<title>sha1_file: add repository argument to sha1_file_name</title>
<updated>2018-03-26T17:05:55Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-03-23T17:21:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cf78ae4f3dcd1cf509a053023cc048f34f72140e'/>
<id>urn:sha1:cf78ae4f3dcd1cf509a053023cc048f34f72140e</id>
<content type='text'>
Add a repository argument to allow sha1_file_name callers 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.

While at it, move the declaration to object-store.h, where it should
be easier to find.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
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>object-store: move packed_git and packed_git_mru to object store</title>
<updated>2018-03-26T17:05:46Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2018-03-23T17:20:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a80d72db2a73174b3f22142eb2014b33696fd795'/>
<id>urn:sha1:a80d72db2a73174b3f22142eb2014b33696fd795</id>
<content type='text'>
In a process with multiple repositories open, packfile accessors
should be associated to a single repository and not shared globally.
Move packed_git and packed_git_mru into the_repository and adjust
callers to reflect this.

[nd: while at there, wrap access to these two fields in get_packed_git()
and get_packed_git_mru(). This allows us to lazily initialize these
fields without caller doing that explicitly]

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
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>http-walker: convert struct object_request to use struct object_id</title>
<updated>2018-03-14T16:23:48Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2018-03-12T02:27:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=16f0705df107410db8454f3726c49d8c488853c9'/>
<id>urn:sha1:16f0705df107410db8454f3726c49d8c488853c9</id>
<content type='text'>
Convert struct object_request to use struct object_id by updating the
definition and applying the following semantic patch, plus the standard
object_id transforms:

@@
struct object_request E1;
@@
- E1.sha1
+ E1.oid.hash

@@
struct object_request *E1;
@@
- E1-&gt;sha1
+ E1-&gt;oid.hash

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>sha1_file: remove static strbuf from sha1_file_name()</title>
<updated>2018-01-17T20:21:32Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2018-01-17T17:54:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ea6577303f4059683f8f257bdecbcafb05001ce9'/>
<id>urn:sha1:ea6577303f4059683f8f257bdecbcafb05001ce9</id>
<content type='text'>
Using a static buffer in sha1_file_name() is error prone
and the performance improvements it gives are not needed
in many of the callers.

So let's get rid of this static buffer and, if necessary
or helpful, let's use one in the caller.

Suggested-by: Jeff Hostetler &lt;git@jeffhostetler.com&gt;
Helped-by: Kevin Daudt &lt;me@ikke.info&gt;
Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pack: move find_sha1_pack()</title>
<updated>2017-08-23T22:12:07Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2017-08-18T22:20:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d6fe0036fd5e0cf7f51aa84381ebd321e898350a'/>
<id>urn:sha1:d6fe0036fd5e0cf7f51aa84381ebd321e898350a</id>
<content type='text'>
Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/http-walker-buffer-underflow-fix'</title>
<updated>2017-03-17T20:50:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-03-17T20:50:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2af882be0181ee29aa3a4fb3181b94e9bca53c51'/>
<id>urn:sha1:2af882be0181ee29aa3a4fb3181b94e9bca53c51</id>
<content type='text'>
"Dumb http" transport used to misparse a nonsense http-alternates
response, which has been fixed.

* jk/http-walker-buffer-underflow-fix:
  http-walker: fix buffer underflow processing remote alternates
</content>
</entry>
<entry>
<title>http-walker: fix buffer underflow processing remote alternates</title>
<updated>2017-03-13T17:20:29Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-03-13T14:04:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d61434ae813cc86a1a87d05cc61e36e87b0e20a9'/>
<id>urn:sha1:d61434ae813cc86a1a87d05cc61e36e87b0e20a9</id>
<content type='text'>
If we parse a remote alternates (or http-alternates), we
expect relative lines like:

  ../../foo.git/objects

which we convert into "$URL/../foo.git/" (and then use that
as a base for fetching more objects).

But if the remote feeds us nonsense like just:

  ../

we will try to blindly strip the last 7 characters, assuming
they contain the string "objects". Since we don't _have_ 7
characters at all, this results in feeding a small negative
value to strbuf_add(), which converts it to a size_t,
resulting in a big positive value. This should consistently
fail (since we can't generall allocate the max size_t minus
7 bytes), so there shouldn't be any security implications.

Let's fix this by using strbuf_strip_suffix() to drop the
characters we want. If they're not present, we'll ignore the
alternate (in theory we could use it as-is, but the rest of
the http-walker code unconditionally tacks "objects/" back
on, so it is it not prepared to handle such a case).

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>http: release strbuf on disabled alternates</title>
<updated>2017-03-06T18:52:57Z</updated>
<author>
<name>Eric Wong</name>
<email>e@80x24.org</email>
</author>
<published>2017-03-04T01:50:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5cae73d5d23ec109322948478a957e77d2733f94'/>
<id>urn:sha1:5cae73d5d23ec109322948478a957e77d2733f94</id>
<content type='text'>
This likely has no real-world impact on memory usage,
but it is cleaner for future readers.

Fixes: abcbdc03895f ("http: respect protocol.*.allow=user for http-alternates")
Signed-off-by: Eric Wong &lt;e@80x24.org&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>http: inform about alternates-as-redirects behavior</title>
<updated>2017-03-06T18:52:15Z</updated>
<author>
<name>Eric Wong</name>
<email>e@80x24.org</email>
</author>
<published>2017-03-04T08:36:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=de46138826cbc8229e25691e613e09ae1f683235'/>
<id>urn:sha1:de46138826cbc8229e25691e613e09ae1f683235</id>
<content type='text'>
It is disconcerting for users to not notice the behavior
change in handling alternates from commit cb4d2d35c4622ec2
("http: treat http-alternates like redirects")

Give the user a hint about the config option so they can
see the URL and decide whether or not they want to enable
http.followRedirects in their config.

Signed-off-by: Eric Wong &lt;e@80x24.org&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
