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

[PATCH v4 0/5] [GSoC] remove_subtree(): reimplement using iterators

From
Daniel Ferreira <bnmvco@gmail.com>
Date
Mar 29, 2017, 00:32 UTC
Message-ID
<1490747533-89143-1-git-send-email-bnmvco@gmail.com>
Hi there,

This is the fourth version of the GSoC microproject of refactoring remove_subtree() from recursively using readdir() to use dir_iterator. Below are the threads for other versions:

v1: https://public-inbox.org/git/CAGZ79kZwT-9mHTiOJ5CEjk2wDFkn6+NcogjX0=vjhsAh16ANYg@mail.gmail.com/T/#t v2: https://public-inbox.org/git/CACsJy8Dxh-QPBBLfaFWPAWUsbA9GVXA7x+mXLjEvYKhk1zOpig@mail.gmail.com/T/#t v3: https://public-inbox.org/git/CAGZ79kYtpmURSQWPumobA=e3JBFjKhWCdv_LPhKCd71ZRwMovA@mail.gmail.com/T/#t

In this version of the patch, I followed Michael's suggestion of splitting the commits responsible for adding the new feature to dir_iterator. His suggestion of using flags instead of an options struct has also been adopted.

This version also contains a test that is finally able to test the function decently (not the one Stefan had suggested, which did not result in a call to remove_subtree). I am just unsure about its location in t/. I'd appreciate suggestions to put it in a more decent home.

Daniel Ferreira (5):
  dir_iterator: add helpers to dir_iterator_advance
  dir_iterator: iterate over dir after its contents
  remove_subtree(): reimplement using iterators
  remove_subtree(): test removing nested directories
  files_reflog_iterator: amend use of dir_iterator
 dir-iterator.c                  | 105 +++++++++++++++++++++++++++++++---------
 dir-iterator.h                  |  14 ++++--
 entry.c                         |  31 ++++--------
 refs/files-backend.c            |   2 +-
 t/t2000-checkout-cache-clash.sh |  11 +++++
 5 files changed, 114 insertions(+), 49 deletions(-)

-- 2.7.4 (Apple Git-66)

Next: Daniel Ferreira
Message 1 of 19 in “[GSoC] remove_subtree(): reimplement using iterators”
  1. 0/5 [GSoC] remove_subtree(): reimplement using iteratorsDaniel Ferreira, Mar 29, 2017
  2. 4/5 remove_subtree(): test removing nested directoriesDaniel Ferreira, Mar 29, 2017
  3. 5/5 files_reflog_iterator: amend use of dir_iteratorDaniel Ferreira, Mar 29, 2017
  4. Michael HaggertyMar 29, 2017
  5. 1/5 dir_iterator: add helpers to dir_iterator_advanceDaniel Ferreira, Mar 29, 2017
  6. Michael HaggertyMar 29, 2017
  7. 3/5 remove_subtree(): reimplement using iteratorsDaniel Ferreira, Mar 29, 2017
  8. Michael HaggertyMar 29, 2017
  9. 2/5 dir_iterator: iterate over dir after its contentsDaniel Ferreira, Mar 29, 2017
  10. Michael HaggertyMar 29, 2017
  11. Michael HaggertyMar 29, 2017
  12. Junio C HamanoMar 29, 2017
  13. Michael HaggertyMar 30, 2017
  14. Junio C HamanoMar 30, 2017
  15. Michael HaggertyMar 30, 2017
  16. Duy NguyenMar 30, 2017
  17. Daniel Ferreira (theiostream)Apr 2, 2017
  18. Duy NguyenApr 5, 2017
  19. Junio C HamanoMar 30, 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.