<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/http.c, branch v1.7.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.7.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.7.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2010-05-21T11:02:19Z</updated>
<entry>
<title>Merge branch 'sp/maint-dumb-http-pack-reidx'</title>
<updated>2010-05-21T11:02:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-05-21T11:02:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=035bf8d7c484b82e3e278af8c91584ae724cb5d4'/>
<id>urn:sha1:035bf8d7c484b82e3e278af8c91584ae724cb5d4</id>
<content type='text'>
* sp/maint-dumb-http-pack-reidx:
  http.c::new_http_pack_request: do away with the temp variable filename
  http-fetch: Use temporary files for pack-*.idx until verified
  http-fetch: Use index-pack rather than verify-pack to check packs
  Allow parse_pack_index on temporary files
  Extract verify_pack_index for reuse from verify_pack
  Introduce close_pack_index to permit replacement
  http.c: Remove unnecessary strdup of sha1_to_hex result
  http.c: Don't store destination name in request structures
  http.c: Drop useless != NULL test in finish_http_pack_request
  http.c: Tiny refactoring of finish_http_pack_request
  t5550-http-fetch: Use subshell for repository operations
  http.c: Remove bad free of static block
</content>
</entry>
<entry>
<title>Merge branch 'rc/maint-curl-helper'</title>
<updated>2010-05-09T05:37:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-05-09T05:37:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3cc9caadf738c3b2cf7aa46364be173751912a10'/>
<id>urn:sha1:3cc9caadf738c3b2cf7aa46364be173751912a10</id>
<content type='text'>
* rc/maint-curl-helper:
  remote-curl: ensure that URLs have a trailing slash
  http: make end_url_with_slash() public
  t5541-http-push: add test for URLs with trailing slash

Conflicts:
	remote-curl.c
</content>
</entry>
<entry>
<title>http.c::new_http_pack_request: do away with the temp variable filename</title>
<updated>2010-04-20T00:57:50Z</updated>
<author>
<name>Tay Ray Chuan</name>
<email>rctay89@gmail.com</email>
</author>
<published>2010-04-19T14:46:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=90d05713575ea6ed21d05228bcda8461f7b28ccf'/>
<id>urn:sha1:90d05713575ea6ed21d05228bcda8461f7b28ccf</id>
<content type='text'>
Now that the temporary variable char *filename is only used in one
place, do away with it and just call sha1_pack_name() directly.

Signed-off-by: Tay Ray Chuan &lt;rctay89@gmail.com&gt;
Acked-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>http-fetch: Use temporary files for pack-*.idx until verified</title>
<updated>2010-04-20T00:56:29Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2010-04-19T14:23:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=750ef42516bb343a7755f003720e43cd8dd64c3e'/>
<id>urn:sha1:750ef42516bb343a7755f003720e43cd8dd64c3e</id>
<content type='text'>
Verify that a downloaded pack-*.idx file is consistent and valid
as an index file before we rename it into its final destination.
This prevents a corrupt index file from later being treated as a
usable file, confusing readers.

Check that we do not have the pack index file before invoking
fetch_pack_index(); that way, we can do without the has_pack_index()
check in fetch_pack_index().

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>http-fetch: Use index-pack rather than verify-pack to check packs</title>
<updated>2010-04-20T00:56:20Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2010-04-19T14:23:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fe72d420ab4dda593dddece7b907ee7868ced127'/>
<id>urn:sha1:fe72d420ab4dda593dddece7b907ee7868ced127</id>
<content type='text'>
To ensure we don't leave a corrupt pack file positioned as though
it were a valid pack file, run index-pack on the temporary pack
before we rename it to its final name.  If index-pack crashes out
when it discovers file corruption (e.g. GitHub's error HTML at the
end of the file), simply delete the temporary files to cleanup.

By waiting until the pack has been validated before we move it
to its final name, we eliminate a race condition where another
concurrent reader might try to access the pack at the same time
that we are still trying to verify its not corrupt.

Switching from verify-pack to index-pack is a change in behavior,
but it should turn out better for users.  The index-pack algorithm
tries to minimize disk seeks, as well as the number of times any
given object is inflated, by organizing its work along delta chains.
The verify-pack logic does not attempt to do this, thrashing the
delta base cache and the filesystem cache.

By recreating the index file locally, we also can automatically
upgrade from a v1 pack table of contents to v2.  This makes the
CRC32 data available for use during later repacks, even if the
server didn't have them on hand.

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Acked-by: Tay Ray Chuan &lt;rctay89@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Allow parse_pack_index on temporary files</title>
<updated>2010-04-20T00:56:17Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2010-04-19T14:23:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7b64469a363c10e9e875a73d32a220ba48694a28'/>
<id>urn:sha1:7b64469a363c10e9e875a73d32a220ba48694a28</id>
<content type='text'>
The easiest way to verify a pack index is to open it through the
standard parse_pack_index function, permitting the header check
to happen when the file is mapped.  However, the dumb HTTP client
needs to verify a pack index before its moved into its proper file
name within the objects/pack directory, to prevent a corrupt index
from being made available.  So permit the caller to specify the
exact path of the index file.

For now we're still using the final destination name within the
sole call site in http.c, but eventually we will start to parse
the temporary path instead.

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>http.c: Remove unnecessary strdup of sha1_to_hex result</title>
<updated>2010-04-20T00:55:59Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2010-04-19T14:23:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=162eb5f838630f75f78f26d28b46b02781724b7d'/>
<id>urn:sha1:162eb5f838630f75f78f26d28b46b02781724b7d</id>
<content type='text'>
Most of the time the dumb HTTP transport is run without the verbose
flag set, so we only need the result of sha1_to_hex(sha1) once, to
construct the pack URL.  Don't bother with an unnecessary malloc,
copy, free chain of this buffer.

If verbose is set, we'll format the SHA-1 twice now.  But this
tiny extra CPU time spent is nothing compared to the slowdown that
is usually imposed by the verbose messages being sent to the tty,
and is entirely trivial compared to the latency involved with the
remote HTTP server sending something as big as a pack file.

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Acked-by: Tay Ray Chuan &lt;rctay89@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>http.c: Don't store destination name in request structures</title>
<updated>2010-04-17T20:55:46Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2010-04-17T20:07:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0da8b2e7c80a6dd9743e5233cdc5acd836c9a8d3'/>
<id>urn:sha1:0da8b2e7c80a6dd9743e5233cdc5acd836c9a8d3</id>
<content type='text'>
The destination name within the object store is easily computed
on demand, reusing a static buffer held by sha1_file.c.  We don't
need to copy the entire path into the request structure for safe
keeping, when it can be easily reformatted after the download has
been completed.

This reduces the size of the per-request structure, and removes
yet another PATH_MAX based limit.

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>http.c: Drop useless != NULL test in finish_http_pack_request</title>
<updated>2010-04-17T20:55:46Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2010-04-17T20:07:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3065274c58a4f4d0c6eef7e29a1484cf2c288131'/>
<id>urn:sha1:3065274c58a4f4d0c6eef7e29a1484cf2c288131</id>
<content type='text'>
The test preq-&gt;packfile != NULL is always true.  If packfile was
actually NULL when entering this function the ftell() above would
crash out with a SIGSEGV, resulting in never reaching this point.

Simplify the code by just removing the conditional.

Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>http.c: Tiny refactoring of finish_http_pack_request</title>
<updated>2010-04-17T20:55:45Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2010-04-17T20:07:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=021ab6f00b66d0d3931310e77383239a606c96c2'/>
<id>urn:sha1:021ab6f00b66d0d3931310e77383239a606c96c2</id>
<content type='text'>
Always remove the struct packed_git from the active list, even
if the rename of the temporary file fails.

While we are here, simplify the code a bit by using a common
local variable name ("p") to hold the relevant packed_git.

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