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

Re: [PATCH 1/6] Open the pack file and keep a map on it.

From
Shawn O. Pearce <spearce@spearce.org>
Date
Oct 5, 2009, 15:27 UTC
Message-ID
<20091005152755.GF9261@spearce.org>
In-Reply-To
<1254593401-18801-2-git-send-email-herve@itaapy.com>
Herv?? Cauwelier <herve@itaapy.com> wrote:
Show 15 quoted lines
> diff --git a/src/odb.h b/src/odb.h
> index 2f205b2..0311d78 100644
> --- a/src/odb.h
> +++ b/src/odb.h
> @@ -11,9 +11,10 @@
>   *   uint32_t *fanout = ... the file data at offset 0 ...
>   *   ntohl(fanout[0]) < ntohl(fanout[1])
>   *
> - * The value chosen here for PACK_TOC is such that the above
> + * The value chosen here for IDX_TOC is such that the above
>   * cannot be true for an idx v1 file.
>   */
> -#define PACK_TOC 0xff744f63 /* -1tOc */
> +#define IDX_TOC 0xff744f63 /* -1tOc */
> +#define PACK_TOC 0x5041434b /* PACK */

FWIW, I wouldn't call the magic string 'PACK' PACK_TOC. TOC here meant "table of contents". The magic string '-1tOc' for PACK_TOC is no accident, its trying to show that this file is a table of contents file.

I think at the time I meant for PACK_TOC to be the pack-*.idx header magic string, and PACK_SIG or PACK_HDR to be the magic string for pack-*.pack.

-- 
Shawn.
Previous: Hervé Cauwelier
Message 8 of 8 in “Patches for libgit2”
  1. Hervé CauwelierOct 3, 2009
  2. 1/6 Open the pack file and keep a map on it.Hervé Cauwelier, Oct 3, 2009
  3. 2/6 Read the base offset or name of delta objectsHervé Cauwelier, Oct 3, 2009
  4. 3/6 Allow zlib to read a pack buffer longer than the actual dataHervé Cauwelier, Oct 3, 2009
  5. 4/6 Inflate an object from a pack fileHervé Cauwelier, Oct 3, 2009
  6. 5/6 This assertion is valid for both loose and packed objectsHervé Cauwelier, Oct 3, 2009
  7. 6/6 Read an object from a pack fileHervé Cauwelier, Oct 3, 2009
  8. Shawn O. PearceOct 5, 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.