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

Re: [PATCH v2] [GSoC] remove_subtree(): reimplement using iterators

From
Duy Nguyen <pclouds@gmail.com>
Date
Mar 25, 2017, 12:29 UTC
Message-ID
<CACsJy8Dxh-QPBBLfaFWPAWUsbA9GVXA7x+mXLjEvYKhk1zOpig@mail.gmail.com>
In-Reply-To
<CAEA2_RK=zMwKeidPDS9u5Ep1htb3TUeOqJ6Cfd644ira4DeXaA@mail.gmail.com>

On Sat, Mar 25, 2017 at 7:13 PM, Daniel Ferreira (theiostream) <bnmvco@gmail.com> wrote:

Show 10 quoted lines
> You are correct, which shows that since all tests pass, we need to
> come up with better cases for this function.
>
> As for a solution, I believe that the best way to go for it is to
> dir_iterator's implementation to have an "Option to iterate over
> directory paths before vs. after their contents" (something predicted
> in the commit that created it). If it iterates over directories after
> all of its contents (currently it does so before) we just need to
> check if the entry is a directory and if so, rmdir() it. Does that
> make sense?

Yes. However since this is a microproject, intended to be done quickly just to get you familiarize with the community and the process, I suggest you look for another readdir() place that can be easily converted to using dir-iterator first so you could go through the whole thing. But of course I will not object you improving dir-iterator and clean remove_subtree() up ;-)

-- 
Duy
Previous: Daniel Ferreira (theiostream)
Message 4 of 4 in “[GSoC] remove_subtree(): reimplement using iterators”
  1. [GSoC] remove_subtree(): reimplement using iteratorsDaniel Ferreira, Mar 25, 2017
  2. Duy NguyenMar 25, 2017
  3. Daniel Ferreira (theiostream)Mar 25, 2017
  4. Duy NguyenMar 25, 2017

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.