git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 00/11] http*: refactor fetching code

From
Tay Ray Chuan <rctay89@gmail.com>
Date
May 16, 2009, 03:50 UTC
Message-ID
<20090516115042.b77829fb.rctay89@gmail.com>

This patch series moves out fetching code from http-push.c and http-walker.c into http.c to reduce code duplicity, and does not attempt to change git's behaviour.

Patch #1 adds rigour to http fetch tests by testing fetching of packed objects, in an effort to ensure that this patch series does not break functionality or change behaviour.

Patch #2 introduces some style fixes, to reduce the number of trivial differences between http-push.c and http-walker.c.

Patch #3 and #5 add features and fixes that were applied on to fetching code in http-push.c or http-walker.c, but not the other. Patch #4, like patch #3, applies onto the code for fetching pack indices (pack-*.idx), and fixes the issue of "mutating" value of the hex variable in fetch_index (especially likely to be encountered when using http-walker.c).

Patch #6 does some simple refactoring of variables and macros.

Patch #7 refactors the logic for appending slashes in quote_ref_url, creating a new method, end_url_with_slash. The latter method will be used in the following patches, since the base urls in http-walker.c and http-push.c are handled differently (ie. the former doesn't include a trailing slash, while the latter does). By using this method throughout, fetching code need not use different printf formatters or differentiate between invocations from http-push.c and http-walker.c.

Patch #8 to #11 refactors code that handles fetching of:
 *pack indices (pack-*.idx)
 *packs
 *pack index (objects/info/packs)
 *loose objects
Tay Ray Chuan (11):
  t5550-http-fetch: test fetching of packed objects
  http-push, http-walker: style fixes
  http-walker: verify remote packs
  http*: copy string returned by sha1_to_hex
  http-push: do not SEGV after fetching a bad pack idx file
  http*: move common variables and macros to http.[ch]
  http: create function end_url_with_slash
  http*: add fetch_http_pack_index
  http*: add helper methods for fetching packs
  http*: add helper methods for fetching objects/info/packs
  http*: add helper methods for fetching objects (loose)
 http-push.c           |  472 +++++-------------------------------------
 http-walker.c         |  525 +++++++++-------------------------------------
 http.c                |  554 ++++++++++++++++++++++++++++++++++++++++++++++++-
 http.h                |   73 +++++++
 t/t5550-http-fetch.sh |    8 +
 5 files changed, 779 insertions(+), 853 deletions(-)
Message 1 of 1 in “http*: refactor fetching code”
  1. 00/11 http*: refactor fetching codeTay Ray Chuan, May 16, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.