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

Re: [PATCH 12/13] dir_iterator: new API for iterating over a directory tree

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Jun 3, 2016, 11:57 UTC
Message-ID
<575170BD.2050604@alum.mit.edu>
In-Reply-To
<1464739954.3988.6.camel@twopensource.com>
On 06/01/2016 02:12 AM, David Turner wrote:
Show 11 quoted lines
> On Mon, 2016-05-30 at 09:55 +0200, Michael Haggerty wrote:
>> +struct dir_iterator_level {
>> +	int initialized;
>> +
>> +	DIR *dir;
>> +
>> +	/*
>> +	 * The length of the directory part of refname at this level
> 
> 
> "refname"? Isn't this was for directories?
Thanks.
Show 5 quoted lines
>> +			if (lstat(iter->base.path.buf, &iter
> ->base.st) < 0)
>> +				continue; /* silently skip */
> 
> Should we warn on non-ENOENT errors here?
Good idea. I'll add that.
Show 5 quoted lines
>> +/*
>> + * End the iteration before it has been exhausted. Free the
>> reference
> 
> s/reference/directory/
Thanks. Will fix.
Michael
Previous: David TurnerNext: Michael Haggerty
Message 26 of 27 in “Reference iterators”
  1. 00/13 Reference iteratorsMichael Haggerty, May 30, 2016
  2. 01/13 refs: remove unnecessary "extern" keywordsMichael Haggerty, May 30, 2016
  3. 02/13 do_for_each_ref(): move docstring to the header fileMichael Haggerty, May 30, 2016
  4. 03/13 refs: use name "prefix" consistentlyMichael Haggerty, May 30, 2016
  5. 04/13 delete_refs(): add a flags argumentMichael Haggerty, May 30, 2016
  6. 05/13 remote rm: handle symbolic refs correctlyMichael Haggerty, May 30, 2016
  7. 06/13 get_ref_cache(): only create an instance if there is a submoduleMichael Haggerty, May 30, 2016
  8. 07/13 entry_resolves_to_object(): rename function from ref_resolves_to_object()Michael Haggerty, May 30, 2016
  9. 08/13 ref_resolves_to_object(): new functionMichael Haggerty, May 30, 2016
  10. 09/13 refs: introduce an iterator interfaceMichael Haggerty, May 30, 2016
  11. Ramsay JonesMay 30, 2016
  12. Ramsay JonesMay 30, 2016
  13. Michael HaggertyMay 31, 2016
  14. Eric SunshineMay 31, 2016
  15. Michael HaggertyMay 31, 2016
  16. Eric SunshineMay 31, 2016
  17. Michael HaggertyJun 3, 2016
  18. Junio C HamanoMay 31, 2016
  19. Michael HaggertyMay 31, 2016
  20. Duy NguyenJun 2, 2016
  21. Michael HaggertyJun 2, 2016
  22. 10/13 do_for_each_ref(): reimplement using reference iterationMichael Haggerty, May 30, 2016
  23. 11/13 for_each_reflog(): don't abort for bad referencesMichael Haggerty, May 30, 2016
  24. 12/13 dir_iterator: new API for iterating over a directory treeMichael Haggerty, May 30, 2016
  25. David TurnerJun 1, 2016
  26. Michael HaggertyJun 3, 2016
  27. 13/13 for_each_reflog(): reimplement using iteratorsMichael Haggerty, May 30, 2016

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.