remove_subtree(): reimplement using iterators
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v11 Latest5 patches 0 repliesNew
- v105 patches 3 repliesSuperseded
- v95 patches 7 repliesSuperseded
Earlier versions · 8
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v8 | 5 patches | 5 replies | Superseded | |
| v7 | 5 patches | 7 replies | Superseded | |
| v6 | 5 patches | 2 replies | Superseded | |
| v5 | 6 patches | 12 replies | Superseded | |
| v4 | 5 patches | 13 replies | Superseded | |
| v3 | 2 patches | 3 replies | Superseded | |
| v2 | 1 patch | 3 replies | Superseded | |
| v1 | 1 patch | 2 replies | Superseded |
Patches in v11 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | dir_iterator: add tests for dir_iterator APIMakefile t/ t/ +1 more | +87 | 0 replies | |
| 2/5 | remove_subtree(): test removing nested directoriest/ | +11 | 0 replies | |
| 3/5 | dir_iterator: refactor dir_iterator_advancedir-iterator.c | +43 | 0 replies | |
| 4/5 | dir_iterator: rewrite state machine modeldir-iterator.c dir-iterator.h refs/ +2 more | +299 | 0 replies | |
| 5/5 | remove_subtree(): reimplement using iteratorsentry.c | +16 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v11 yet.
Cover letter [PATCH v11 0/5] [GSoC] remove_subtree(): reimplement using iterators
This is the eleventh 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/[email protected]/T/#e437a63e0c22c00c69b5d92977c9b438ed2b9fd3a
v5: https://public-inbox.org/git/[email protected]/T/#m2323f15e45de699f2e09364f40a62e17047cf453
v6: https://public-inbox.org/git/[email protected]/T/#t
v7: https://public-inbox.org/git/[email protected]/T/#t
v8: https://public-inbox.org/git/[email protected]/T/#t
v9: https://public-inbox.org/git/CAGZ79kaBRS0SFAvrV4mN7-mVk+8QmPKPJMD55zPQ+A14ZzYFYA@mail.gmail.com/T/#me8988b7dd4adbc4ea24946ccb24fc1cf7baf44e3
v10: https://public-inbox.org/git/[email protected]/T/#m3071006ec67457adf69578b37f55b625d0e7fed7
Travis CI build: https://travis-ci.org/theiostream/git/builds/226079792
Okay, in this version I factored in Junio's request for a test rename to t0066, and most of Michael's suggestions from the last review. I'm sorry for the delay on this one.
Instead of either removing the iterate root dir feature or return NULL as its basename, I chose to get the real_path() out of the dir we are iterating over and get the basename of that, to avoid the "/." or "/.." issues. I think this is actually less complex than the NULL solution in terms of code that would end up needing to be written, and I think the root dir feature is handy to have on dir-iterator.
As for the suggestion to put strerror() on the test, I feared for the message compatibility across platforms (since we actually check which errno code we got). If you could give me a guarantee that this is not a problem and you think it'd be worthy of yet another series, I'm up for it.
As for Junio's concern for a rebase issue on the test script, the reason for it was that the same file is used across two tests, so it seemed unnecessary to recreate the file within each of them.
Daniel Ferreira (5):
dir_iterator: add tests for dir_iterator API remove_subtree(): test removing nested directories
dir_iterator: refactor dir_iterator_advance
dir_iterator: rewrite state machine model remove_subtree(): reimplement using iterators
Makefile | 1 + dir-iterator.c | 244 ++++++++++++++++++++++++++++------------ dir-iterator.h | 35 ++++-- entry.c | 42 +++---- refs/files-backend.c | 15 ++- t/helper/.gitignore | 1 + t/helper/test-dir-iterator.c | 53 +++++++++ t/t0066-dir-iterator.sh | 121 ++++++++++++++++++++ t/t2000-checkout-cache-clash.sh | 11 ++ 9 files changed, 416 insertions(+), 107 deletions(-) create mode 100644 t/helper/test-dir-iterator.c create mode 100755 t/t0066-dir-iterator.sh
--
2.7.4 (Apple Git-66)