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

Re: 'git fast-export' is crashing on the gcc repo

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 12, 2007, 08:56 UTC
Message-ID
<7vy7c08f5o.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<854peo8fm5.fsf@lola.goethe.zz>
David Kastrup <dak@gnu.org> writes:
Show 7 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> ...
>> Still, I like your swapping of size and nmemb parameters, regardless
>> of the "don't bother calling fwrite(3) if size is zero" fix.
>
> I don't.  Far too obscure, looks like an unintentional wart waiting to
> be corrected.

Oh, I did not mean it in the sense that would be a bugfix, but in the sense that we are writing N instances of 1 byte, not 1 instance of N byte blob, and should express size and nmemb parameters to fwrite(3) as such. IOW, I would have preferred:

	if (size && fwrite(buf, 1, size, stdout) != size)
        	barf(...);
Previous: David Kastrup
Message 10 of 10 in “'git fast-export' is crashing on the gcc repo”
  1. Nicolas PitreDec 11, 2007
  2. Marco CostalbaDec 11, 2007
  3. Fix git-fast-export for zero-sized blobsAlex Riesen, Dec 11, 2007
  4. Nicolas PitreDec 11, 2007
  5. Nicolas PitreDec 11, 2007
  6. Alex RiesenDec 12, 2007
  7. Nicolas PitreDec 12, 2007
  8. Junio C HamanoDec 12, 2007
  9. David KastrupDec 12, 2007
  10. Junio C HamanoDec 12, 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.