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

Re: [PATCH 3/3] fast-import: rename object_count to pack_object_count

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Sep 18, 2011, 21:40 UTC
Message-ID
<20110918214010.GK2308@elie>
In-Reply-To
<CA+gfSn8aOWPm=xmTE9WzuXsQY0EfYypFxRAyVb-x3_kmhNUb-Q@mail.gmail.com>
Dmitry Ivankov wrote:
> --- a/fast-import.c
> +++ b/fast-import.c
[...]
Show 15 quoted lines
> @@ -310,8 +309,16 @@ static unsigned int atom_cnt;
>  static struct atom_str **atom_table;
> 
>  /* The .pack file being generated */
> +/*
> + * objects that are being written to the current pack
> + * all *must* have current pack_id in struct object_entry.
> + * And object_count *must* be a count of object_entry's
> + * having current pack_id. This data is used to create
> + * index file once current pack_file is finished.
> + */
>  static struct pack_idx_option pack_idx_opts;
>  static unsigned int pack_id;
> +static unsigned long object_count;
>  static struct sha1file *pack_file;

Closer. Now I am tempted to nitpick and say that this should be a single comment, formatted in complete sentences, and written to be descriptive rather than normative when possible (since norms will inevitably change over time, and future readers should not have an excuse to be afraid to adjust the comment to match code changes).

	/*
	 * The .pack file being generated
	 *
	 * Objects that are being written to the current pack store the
	 * current value of "pack_id" in struct object_entry.
	 * "object_count" counts the object_entrys with the current
	 * pack_id.  These values are used to create the pack index
	 * file when the current pack is finished.
	 */
	static struct pack_idx_option pack_idx_opts;
	static unsigned int pack_id;
	...
Previous: Dmitry Ivankov
Message 9 of 9 in “fast-import: fix pack_id corner cases”
  1. 0/3 fast-import: fix pack_id corner casesDmitry Ivankov, Sep 18, 2011
  2. 1/3 fast-import: die if we produce too many (MAX_PACK_ID) packsDmitry Ivankov, Sep 18, 2011
  3. Jonathan NiederSep 18, 2011
  4. 2/3 fast-import: fix corner case for checkpointDmitry Ivankov, Sep 18, 2011
  5. Jonathan NiederSep 18, 2011
  6. 3/3 fast-import: rename object_count to pack_object_countDmitry Ivankov, Sep 18, 2011
  7. Jonathan NiederSep 18, 2011
  8. Dmitry IvankovSep 18, 2011
  9. Jonathan NiederSep 18, 2011

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.