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

Re: [PATCH v3 0/2] [GSoC] remove_subtree(): reimplement using iterators

From
Stefan Beller <sbeller@google.com>
Date
Mar 28, 2017, 17:13 UTC
Message-ID
<CAGZ79kYtpmURSQWPumobA=e3JBFjKhWCdv_LPhKCd71ZRwMovA@mail.gmail.com>
In-Reply-To
<1490465551-71056-1-git-send-email-bnmvco@gmail.com>
On Sat, Mar 25, 2017 at 11:12 AM, Daniel Ferreira <bnmvco@gmail.com> wrote:
Show 20 quoted lines
> This is the third 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/#mae023e7a7d7626f00e0923833c4359f5af493730
> v2: https://public-inbox.org/git/CACsJy8Dxh-QPBBLfaFWPAWUsbA9GVXA7x+mXLjEvYKhk1zOpig@mail.gmail.com/T/#t
>
> Duy suggested adding features to dir_iterator might go
> beyond the intention of a microproject, but I figured I
> might go for it to learn more about the project.
>
> The dir_iterator reimplementation has been tested in a
> separate binary I created (and linked with libgit.a) to
> reproduce remove_subtree()'s contents. As pointed out in the
> last thread, git's tests for this function were unable to
> catch a daunting bug I had introduced, and I still haven't
> been able to come up with a way to reproduce remove_subtree()
> being called. Any help?
>
I would think a test llike the following would work:
test_expect_success 'remove nested subtrees' '
    test_commit initial &&
    mkdir -p dir/with/nested/dir &&
    echo content >dir/with/nested/dir/file &&
    echo content >dir/file &&
    git add dir/with/nested/dir/file dir/file &&
    git commit -a -m "commit directory structure" &&
    git checkout initial &&
    ! test dir
'
Previous: Michael Haggerty
Message 6 of 6 in “[GSoC] remove_subtree(): reimplement using iterators”
  1. 0/2 [GSoC] remove_subtree(): reimplement using iteratorsDaniel Ferreira, Mar 25, 2017
  2. 2/2 [GSoC] remove_subtree(): reimplement using iteratorsDaniel Ferreira, Mar 25, 2017
  3. 1/2 [GSoC] dir_iterator: iterate over dir after its contentsDaniel Ferreira, Mar 25, 2017
  4. Michael HaggertyMar 26, 2017
  5. Michael HaggertyMar 26, 2017
  6. Stefan BellerMar 28, 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.