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

Re: [PATCH] fread does not return negative on error

From
IMIngo Molnar <mingo@elte.hu>
Date
Jun 24, 2009, 08:18 UTC
Message-ID
<20090624081819.GA10436@elte.hu>
In-Reply-To
<7vhby64i8f.fsf@alter.siamese.dyndns.org>
* Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
> René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
> 
> > the following patch is for git.  I just removed the unneeded check for
> > res == 0 from your version.  Does it look OK?
> 
> The patch looks good, and both of our in-tree users do error out 
> when the returned value is 0 (imap-send.c checks with "<= 0" which 
> looks a tad amateurish, though) correctly.
> 
> Funny, there is no caller of this function in the original context 
> this bug originally found, which I think is linux-2.6/tools/perf 
> ;-).
Hehe, yes :-)
Background: when creating tools/perf/ i cherry-picked all the nice 
Git libraries into tools/perf/util/, to give a standard environment 
for all tooling things that might come up in the future.

Some of those are not used yet but it looked more logical to pick up whole pieces - some already gained uses. For example config.c is not truly used yet, but very much expected to have a role in the future.

( The only invasive thing i had to do was the s/git_/perf_/ mass 
  rename across all the files - having 'git_' in perf looked
  quite confusing. )

And our general experience with the Git libraries in tools/perf/util/* is: we love them!

For example parse-options.c is a striking improvement compared to getopt.h we used before, and all the other facilities are sane and straight to the point as well. So in this sense 'perf' is an ... interesting cross-discipline 'fork' of Git's generic libraries.

The auto-generation of everything out of Documentation/*.txt is another thing we picked up, and that's very nice too.

One bookeeping issue: i found few explicit credits in those files - so i noted in the changelog that i took them from Git and i noted the specific upstream Git sha1 when i copied them. Would be nice to update each file with names to make credit more explicit:

-rw-rw-r-- 1 mingo mingo 2808 2009-06-23 10:49 abspath.c -rw-rw-r-- 1 mingo mingo 1447 2009-06-23 10:49 alias.c -rw-rw-r-- 1 mingo mingo 4660 2009-06-23 10:49 cache.h -rw-rw-r-- 1 mingo mingo 4817 2009-06-23 10:49 color.c -rw-rw-r-- 1 mingo mingo 1187 2009-06-23 10:49 color.h -rw-rw-r-- 1 mingo mingo 19149 2009-06-23 10:49 config.c -rw-rw-r-- 1 mingo mingo 1041 2009-06-23 10:52 ctype.c -rw-rw-r-- 1 mingo mingo 256 2009-06-23 10:49 environment.c -rw-rw-r-- 1 mingo mingo 3262 2009-06-23 10:49 exec_cmd.c -rw-rw-r-- 1 mingo mingo 496 2009-06-23 10:49 exec_cmd.h -rw-rw-r-- 1 mingo mingo 8515 2009-06-23 10:49 help.c -rw-rw-r-- 1 mingo mingo 751 2009-06-23 10:49 help.h -rw-rw-r-- 1 mingo mingo 2592 2009-06-23 10:49 levenshtein.c -rw-rw-r-- 1 mingo mingo 201 2009-06-23 10:49 levenshtein.h -rw-rw-r-- 1 mingo mingo 1909 2009-06-23 10:49 pager.c -rw-rw-r-- 1 mingo mingo 12454 2009-06-23 10:49 parse-options.c -rw-rw-r-- 1 mingo mingo 5693 2009-06-23 10:49 parse-options.h -rw-rw-r-- 1 mingo mingo 7986 2009-06-23 10:49 path.c -rw-rw-r-- 1 mingo mingo 10442 2009-06-23 10:49 quote.c -rw-rw-r-- 1 mingo mingo 2667 2009-06-23 10:49 quote.h -rw-rw-r-- 1 mingo mingo 7966 2009-06-23 10:49 run-command.c -rw-rw-r-- 1 mingo mingo 2838 2009-06-23 10:49 run-command.h -rw-rw-r-- 1 mingo mingo 969 2009-06-23 10:49 sigchain.c -rw-rw-r-- 1 mingo mingo 215 2009-06-23 10:49 sigchain.h -rw-rw-r-- 1 mingo mingo 7270 2009-06-23 10:49 strbuf.c -rw-rw-r-- 1 mingo mingo 4995 2009-06-23 10:49 strbuf.h -rw-rw-r-- 1 mingo mingo 556 2009-06-23 10:52 string.c -rw-rw-r-- 1 mingo mingo 120 2009-06-23 10:52 string.h -rw-rw-r-- 1 mingo mingo 13859 2009-06-24 10:01 symbol.c -rw-rw-r-- 1 mingo mingo 1112 2009-06-23 10:52 symbol.h -rw-rw-r-- 1 mingo mingo 1690 2009-06-23 10:49 usage.c -rw-rw-r-- 1 mingo mingo 9878 2009-06-23 10:52 util.h -rw-rw-r-- 1 mingo mingo 4249 2009-06-23 10:49 wrapper.c

	Ingo
Previous: Junio C HamanoNext: Johannes Schindelin
Message 5 of 14 in “Re: [PATCH] tools: fread does not return negative on error”
  1. Ingo MolnarJun 22, 2009
  2. roel kluinJun 22, 2009
  3. fread does not return negative on errorRené Scharfe, Jun 22, 2009
  4. Junio C HamanoJun 23, 2009
  5. Ingo MolnarJun 24, 2009
  6. Johannes SchindelinJun 24, 2009
  7. Junio C HamanoJun 24, 2009
  8. Johannes SchindelinJun 24, 2009
  9. Ingo MolnarJun 24, 2009
  10. Alex RiesenJun 24, 2009
  11. Junio C HamanoJun 24, 2009
  12. Christian CouderJun 24, 2009
  13. Ingo MolnarJun 24, 2009
  14. Junio C HamanoJun 25, 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.