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

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

From
Daniel Ferreira <bnmvco@gmail.com>
Date
Apr 2, 2017, 20:03 UTC
Message-ID
<1491163388-41255-1-git-send-email-bnmvco@gmail.com>

This is the seventh version of a patch series that implements the GSoC microproject of converting a recursive call to readdir() to use dir_iterator.

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 v4: https://public-inbox.org/git/1490747533-89143-1-git-send-email-bnmvco@gmail.com/T/#e437a63e0c22c00c69b5d92977c9b438ed2b9fd3a v5: https://public-inbox.org/git/1490844730-47634-1-git-send-email-bnmvco@gmail.com/T/#m2323f15e45de699f2e09364f40a62e17047cf453 v6: https://public-inbox.org/git/1491107726-21504-1-git-send-email-bnmvco@gmail.com/T/#t

I screwed up in v6 because I had introduced a bug that in case git tried to open a directory that did not exist using dir_iterator, the program would segfault. This was amended and all commits are passing the tests. Sorry for not having tested my changes properly.

CI build: https://travis-ci.org/theiostream/git

Since the changes in v6 were not reviewed, I'll just copy what was sent back there.

Show 8 quoted lines
> Back in v5, Michael had a number of suggestions, all of which were applied
> to this version (including a slightly modified version of his "biggish rewrite"
> project to make dir_iterator's state machine simpler). The only suggestion that
> did not make it into this series was that of not traversing into subdirectories,
> since I believe it would be better off in another series that actually required
> that feature (that is, I do not want a series to implement a feature it will
> not need). The same goes for Junio's thought on a flag to list *only* directories
> and no files on the v4 discussion.
> Junio and Peff's comments about how to write to files in the tests were also
> considered, and the tests were adjusted.
Show 5 quoted lines
> I chose to squash both the state machine refactor and the addition of the
> new flags in a single commit. I do not know whether you will feel this is
> the right choice but it seemed natural, since most of the state machine's
> new logic would not even make sense without encompassing the new features.
> I am, of course, open for feedback on this decision.
Daniel Ferreira (5):
  dir_iterator: add tests for dir_iterator API
  remove_subtree(): test removing nested directories
  dir_iterator: add helpers to dir_iterator_advance
  dir_iterator: refactor state machine model
  remove_subtree(): reimplement using iterators
 Makefile                        |   1 +
 dir-iterator.c                  | 196 ++++++++++++++++++++++++++--------------
 dir-iterator.h                  |  28 ++++--
 entry.c                         |  38 +++-----
 refs/files-backend.c            |   2 +-
 t/helper/.gitignore             |   1 +
 t/helper/test-dir-iterator.c    |  32 +++++++
 t/t0065-dir-iterator.sh         | 109 ++++++++++++++++++++++
 t/t2000-checkout-cache-clash.sh |  11 +++
 9 files changed, 316 insertions(+), 102 deletions(-)
 create mode 100644 t/helper/test-dir-iterator.c
 create mode 100755 t/t0065-dir-iterator.sh

-- 2.7.4 (Apple Git-66)

Next: Daniel Ferreira
Message 1 of 13 in “[GSoC] remove_subtree(): reimplement using iterators”
  1. 0/5 [GSoC] remove_subtree(): reimplement using iteratorsDaniel Ferreira, Apr 2, 2017
  2. 1/5 dir_iterator: add tests for dir_iterator APIDaniel Ferreira, Apr 2, 2017
  3. Stefan BellerApr 3, 2017
  4. 2/5 remove_subtree(): test removing nested directoriesDaniel Ferreira, Apr 2, 2017
  5. Stefan BellerApr 3, 2017
  6. 3/5 dir_iterator: add helpers to dir_iterator_advanceDaniel Ferreira, Apr 2, 2017
  7. Stefan BellerApr 3, 2017
  8. 4/5 dir_iterator: refactor state machine modelDaniel Ferreira, Apr 2, 2017
  9. Michael HaggertyApr 3, 2017
  10. Daniel Ferreira (theiostream)Apr 3, 2017
  11. Michael HaggertyApr 4, 2017
  12. 5/5 remove_subtree(): reimplement using iteratorsDaniel Ferreira, Apr 2, 2017
  13. Michael HaggertyApr 3, 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.