git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH v8 0/5] [GSoC] remove_subtree(): reimplement using iterators
@ 2017-04-06  1:39 Daniel Ferreira
  2017-04-06  1:39 ` [PATCH v8 1/5] dir_iterator: add tests for dir_iterator API Daniel Ferreira
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Daniel Ferreira @ 2017-04-06  1:39 UTC (permalink / raw)
  To: git; +Cc: gitster, sbeller, pclouds, mhagger, Daniel Ferreira

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
v7: https://public-inbox.org/git/1491163388-41255-1-git-send-email-bnmvco@gmail.com/T/#t

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

In this version, I applied pretty much all suggestions Michael and Stefan had
for the patch.

Michael, regarding the patch you sent for parsing the arguments on the
test-dir-iterator helper, I did not squash because it'd generate too many
merge conflicts. I just preferred add your code manually. Let me know how I
can properly credit you for it.

The only "controversial" part of this code is how I ended up caching the result
of lstat() on the dir_iterator_level struct. Having to handle the case of the
root directory ended up making set_iterator_data() way more complicated (having
to handle the case of level->stat not being set by push_dir_level()), as well
as required the introduction of st_is_set member in the level struct. This issue
would be solved if we could lstat() the root dir on dir_iterator_begin() and
possibly return an error there. Regardless, I appreciate other suggestions to
make this less complex.

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                  | 247 +++++++++++++++++++++++++++++-----------
 dir-iterator.h                  |  35 ++++--
 entry.c                         |  39 +++----
 refs/files-backend.c            |   2 +-
 t/helper/.gitignore             |   1 +
 t/helper/test-dir-iterator.c    |  48 ++++++++
 t/t0065-dir-iterator.sh         |  93 +++++++++++++++
 t/t2000-checkout-cache-clash.sh |  11 ++
 9 files changed, 373 insertions(+), 104 deletions(-)
 create mode 100644 t/helper/test-dir-iterator.c
 create mode 100755 t/t0065-dir-iterator.sh

--
2.7.4 (Apple Git-66)


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-04-17  6:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06  1:39 [PATCH v8 0/5] [GSoC] remove_subtree(): reimplement using iterators Daniel Ferreira
2017-04-06  1:39 ` [PATCH v8 1/5] dir_iterator: add tests for dir_iterator API Daniel Ferreira
2017-04-13  0:42   ` Stefan Beller
2017-04-06  1:39 ` [PATCH v8 2/5] remove_subtree(): test removing nested directories Daniel Ferreira
2017-04-06  1:39 ` [PATCH v8 3/5] dir_iterator: add helpers to dir_iterator_advance Daniel Ferreira
2017-04-06  1:39 ` [PATCH v8 4/5] dir_iterator: refactor state machine model Daniel Ferreira
2017-04-17  6:52   ` Michael Haggerty
2017-04-06  1:39 ` [PATCH v8 5/5] remove_subtree(): reimplement using iterators Daniel Ferreira
2017-04-13  0:06 ` [PATCH v8 0/5] [GSoC] " Daniel Ferreira (theiostream)
2017-04-13  0:50   ` Stefan Beller
2017-04-17  6:29 ` Michael Haggerty

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).