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

Re: [PATCH 4/8] git-repack --max-pack-size: add fixup_header_footer()

From
Nicolas Pitre <nico@cam.org>
Date
Apr 9, 2007, 00:18 UTC
Message-ID
<alpine.LFD.0.98.0704082012220.28181@xanadu.home>
In-Reply-To
<7vwt0m76rv.fsf@assigned-by-dhcp.cox.net>
On Sun, 8 Apr 2007, Junio C Hamano wrote:
Show 17 quoted lines
> Dana How <danahow@gmail.com> writes:
> 
> > +/*
> > + * Move this, the version in fast-import.c,
> > + * and index_pack.c:readjust_pack_header_and_sha1 into sha1_file.c ?
> > + */
> > +static void fixup_header_footer(int pack_fd, unsigned char *pack_file_sha1,
> > +				char *pack_name, uint32_t object_count)
> > +{
> 
> Indeed that is a very good point.
> 
> I admit I did not notice we already had the duplication between
> fast-import.c and index-pack.c
> 
> Shawn, Nico, what do you think?  Wouldn't it be better to
> refactor them first, independent of Dana's series?

Probably, yes. But probably not in sha1_file.c though. This file is getting a bit large already, and it deals with pack reading only not pack writing.

I think another file with common pack writing functions could be created. Pack index writing is another item that is currently duplicated in pack-objects and index-pack for example.

Nicolas
Previous: Junio C HamanoNext: Shawn O. Pearce
Message 3 of 10 in “git-repack --max-pack-size: add fixup_header_footer()”
  1. 4/8 git-repack --max-pack-size: add fixup_header_footer()Dana How, Apr 8, 2007
  2. Junio C HamanoApr 9, 2007
  3. Nicolas PitreApr 9, 2007
  4. Shawn O. PearceApr 9, 2007
  5. Nicolas PitreApr 9, 2007
  6. Shawn O. PearceApr 9, 2007
  7. Dana HowApr 9, 2007
  8. Nicolas PitreApr 9, 2007
  9. Dana HowApr 9, 2007
  10. Nicolas PitreApr 9, 2007

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.