[PATCH] [GSoC] remove_subtree(): reimplement using iterators

2017-03-23 Thread Daniel Ferreira
in purpose was previously done at 46d092a ("for_each_reflog(): reimplement using iterators", 2016-05-21). Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- Hey there! This is my microproject for Google Summer of Code on git. It has passed on Travis CI (https://travis-ci.org

[PATCH v2] [GSoC] remove_subtree(): reimplement using iterators

2017-03-25 Thread Daniel Ferreira
Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- This is a second-version patch of the Google Summer of Code microproject for refactoring recursive readdir() calls to use dir_iterator instead. v1 can be found in: https://public-inbox.org/git/CAGZ79kZwT-9mHTiOJ5CEjk2wDFkn6+N

[PATCH v4 2/5] dir_iterator: iterate over dir after its contents

2017-03-28 Thread Daniel Ferreira
tents have been wiped. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- dir-iterator.c | 46 ++ dir-iterator.h | 14 +++--- 2 files changed, 53 insertions(+), 7 deletions(-) diff --git a/dir-iterator.c b/dir-iterator.c index 853c040.

[PATCH v4 5/5] files_reflog_iterator: amend use of dir_iterator

2017-03-28 Thread Daniel Ferreira
Amend a call to dir_iterator_begin() to pass the flags parameter introduced in 3efb5c0 ("dir_iterator: iterate over dir after its contents", 2017-28-03). Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- refs/files-backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

[PATCH v4 1/5] dir_iterator: add helpers to dir_iterator_advance

2017-03-28 Thread Daniel Ferreira
Create inline helpers to dir_iterator_advance(). Make dir_iterator_advance()'s code more legible and allow some behavior to be reusable. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- dir-iterator.c | 65 +- 1 file chang

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

2017-03-28 Thread Daniel Ferreira
Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- entry.c | 31 ++- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/entry.c b/entry.c index c6eea24..bbebd16 100644 --- a/entry.c +++ b/entry.c @@ -2,6 +2,8 @@ #include "blob.h"

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

2017-03-28 Thread Daniel Ferreira
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

[PATCH v4 4/5] remove_subtree(): test removing nested directories

2017-03-28 Thread Daniel Ferreira
() pass the tests. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- t/t2000-checkout-cache-clash.sh | 11 +++ 1 file changed, 11 insertions(+) diff --git a/t/t2000-checkout-cache-clash.sh b/t/t2000-checkout-cache-clash.sh index de3edb5..ac10ba3 100755 --- a/t/t2000-checkout

[PATCH v5 0/6] [GSoC] remove_subtree(): reimplement using iterators

2017-03-29 Thread Daniel Ferreira
is greatly appreciated. Thanks, Daniel. Daniel Ferreira (6): dir_iterator: add helpers to dir_iterator_advance dir_iterator: refactor state machine model dir_iterator: iterate over dir after its contents dir_iterator: add tests for dir_iterator API remove_subtree(): reimplement using

[PATCH v5 3/6] dir_iterator: iterate over dir after its contents

2017-03-29 Thread Daniel Ferreira
ntents have been wiped. Amend a call to dir_iterator_begin() to pass the flags parameter introduced. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- dir-iterator.c | 53 dir-iterator.h | 17 - refs/file

[PATCH v5 5/6] remove_subtree(): reimplement using iterators

2017-03-29 Thread Daniel Ferreira
From: Daniel Ferreira <daniel.calib...@gmail.com> Use dir_iterator to traverse through remove_subtree()'s directory tree, avoiding the need for recursive calls to readdir(). Simplify remove_subtree()'s code. A conversion similar in purpose was previously done at 46d092a ("for_

[PATCH v5 6/6] remove_subtree(): test removing nested directories

2017-03-29 Thread Daniel Ferreira
() pass the tests. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- t/t2000-checkout-cache-clash.sh | 11 +++ 1 file changed, 11 insertions(+) diff --git a/t/t2000-checkout-cache-clash.sh b/t/t2000-checkout-cache-clash.sh index de3edb5..ac10ba3 100755 --- a/t/t2000-checkout

[PATCH v5 4/6] dir_iterator: add tests for dir_iterator API

2017-03-29 Thread Daniel Ferreira
. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- Makefile | 1 + t/helper/test-dir-iterator.c | 32 +++ t/t0065-dir-iterator.sh | 45 3 files changed, 78 insertions(+) create mode 10

[PATCH v5 2/6] dir_iterator: refactor state machine model

2017-03-29 Thread Daniel Ferreira
Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- dir-iterator.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dir-iterator.c b/dir-iterator.c index ce8bf81..3ac984b 100644 --- a/dir-iterator.c +++ b/dir-iterator.c @@ -4,8 +4,6 @@ #include "dir

[PATCH v5 1/6] dir_iterator: add helpers to dir_iterator_advance

2017-03-29 Thread Daniel Ferreira
Create inline helpers to dir_iterator_advance(). Make dir_iterator_advance()'s code more legible and allow some behavior to be reusable. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- dir-iterator.c | 65 +- 1 file chang

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

2017-03-25 Thread Daniel Ferreira
to come up with a way to reproduce remove_subtree() being called. Any help? Thank you all again for all the reviews. Daniel Ferreira (2): dir_iterator: iterate over dir after its contents remove_subtree(): reimplement using iterators dir-iterator.c | 100

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

2017-03-25 Thread Daniel Ferreira
Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- entry.c | 32 +++- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/entry.c b/entry.c index c6eea24..670ffeb 100644 --- a/entry.c +++ b/entry.c @@ -2,6 +2,8 @@ #include "blob.h"

[PATCH v3 1/2] [GSoC] dir_iterator: iterate over dir after its contents

2017-03-25 Thread Daniel Ferreira
added to avoid either breaking the current dir_iterator API or over-engineering an extremely simple option architecture. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- dir-iterator.c | 100 - dir-iterator.h | 7 2 files cha

[PATCH v6 4/5] dir_iterator: refactor state machine model

2017-04-01 Thread Daniel Ferreira
ator.sh and t/helper/test-dir-iterator.c to test "post-order" and "iterate-over-root" modes. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- dir-iterator.c | 149 +++ dir-iterator.h | 28

[PATCH v6 2/5] remove_subtree(): test removing nested directories

2017-04-01 Thread Daniel Ferreira
() pass the tests. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- t/t2000-checkout-cache-clash.sh | 11 +++ 1 file changed, 11 insertions(+) diff --git a/t/t2000-checkout-cache-clash.sh b/t/t2000-checkout-cache-clash.sh index de3edb5..ac10ba3 100755 --- a/t/t2000-checkout

[PATCH v6 1/5] dir_iterator: add tests for dir_iterator API

2017-04-01 Thread Daniel Ferreira
Create t/helper/test-dir-iterator.c, which prints relevant information about a directory tree iterated over with dir_iterator. Create t/t0065-dir-iterator.sh, which tests that dir_iterator does iterate through a whole directory tree. Signed-off-by: Daniel Ferreira <bnm...@gmail.

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

2017-04-01 Thread Daniel Ferreira
s decision. To Michael and Duy, thanks -- really -- for the encouraging comments! :) I never regarded this microproject purely as a means to fulfill a GSoC requirement, but as a way to get to learn more about Git, so I'm surely not giving it up. Once again, thanks for all the previous reviews, Daniel. Danie

[PATCH v6 5/5] remove_subtree(): reimplement using iterators

2017-04-01 Thread Daniel Ferreira
Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- entry.c | 38 -- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/entry.c b/entry.c index c6eea24..309b9ad 100644 --- a/entry.c +++ b/entry.c @@ -2,6 +2,8 @@ #include "blob.h"

[PATCH v6 3/5] dir_iterator: add helpers to dir_iterator_advance

2017-04-01 Thread Daniel Ferreira
Create inline helpers to dir_iterator_advance(). Make dir_iterator_advance()'s code more legible and allow some behavior to be reusable. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- dir-iterator.c | 65 +- 1 file chang

[PATCH v7 4/5] dir_iterator: refactor state machine model

2017-04-02 Thread Daniel Ferreira
ator.sh and t/helper/test-dir-iterator.c to test "post-order" and "iterate-over-root" modes. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- dir-iterator.c | 155 +++ dir-iterator.h | 28

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

2017-04-02 Thread Daniel Ferreira
From: Daniel Ferreira <daniel.calib...@gmail.com> Use dir_iterator to traverse through remove_subtree()'s directory tree, avoiding the need for recursive calls to readdir(). Simplify remove_subtree()'s code. A conversion similar in purpose was previously done at 46d092a ("for_

[PATCH v7 1/5] dir_iterator: add tests for dir_iterator API

2017-04-02 Thread Daniel Ferreira
Create t/helper/test-dir-iterator.c, which prints relevant information about a directory tree iterated over with dir_iterator. Create t/t0065-dir-iterator.sh, which tests that dir_iterator does iterate through a whole directory tree. Signed-off-by: Daniel Ferreira <bnm...@gmail.

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

2017-04-02 Thread Daniel Ferreira
> 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

[PATCH v7 3/5] dir_iterator: add helpers to dir_iterator_advance

2017-04-02 Thread Daniel Ferreira
Create inline helpers to dir_iterator_advance(). Make dir_iterator_advance()'s code more legible and allow some behavior to be reusable. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- dir-iterator.c | 65 +- 1 file chang

[PATCH v7 2/5] remove_subtree(): test removing nested directories

2017-04-02 Thread Daniel Ferreira
() pass the tests. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- t/t2000-checkout-cache-clash.sh | 11 +++ 1 file changed, 11 insertions(+) diff --git a/t/t2000-checkout-cache-clash.sh b/t/t2000-checkout-cache-clash.sh index de3edb5..ac10ba3 100755 --- a/t/t2000-checkout

[PATCH v8 1/5] dir_iterator: add tests for dir_iterator API

2017-04-05 Thread Daniel Ferreira
Create t/helper/test-dir-iterator.c, which prints relevant information about a directory tree iterated over with dir_iterator. Create t/t0065-dir-iterator.sh, which tests that dir_iterator does iterate through a whole directory tree. Signed-off-by: Daniel Ferreira <bnm...@gmail.

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

2017-04-05 Thread Daniel Ferreira
terator_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

[PATCH v8 2/5] remove_subtree(): test removing nested directories

2017-04-05 Thread Daniel Ferreira
() pass the tests. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- t/t2000-checkout-cache-clash.sh | 11 +++ 1 file changed, 11 insertions(+) diff --git a/t/t2000-checkout-cache-clash.sh b/t/t2000-checkout-cache-clash.sh index de3edb5..ac10ba3 100755 --- a/t/t2000-checkout

[PATCH v8 4/5] dir_iterator: refactor state machine model

2017-04-05 Thread Daniel Ferreira
ator.sh and t/helper/test-dir-iterator.c to test "post-order" and "iterate-over-root" modes. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- dir-iterator.c | 216 ++- dir-iterator.h | 35 +-- r

[PATCH v8 3/5] dir_iterator: add helpers to dir_iterator_advance

2017-04-05 Thread Daniel Ferreira
Create helpers to dir_iterator_advance(). Make dir_iterator_advance()'s code more legible and allow some behavior to be reusable. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- dir-iterator.c | 65 +- 1 file changed, 42 inse

[PATCH v8 5/5] remove_subtree(): reimplement using iterators

2017-04-05 Thread Daniel Ferreira
Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- entry.c | 39 +-- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/entry.c b/entry.c index d2b512d..d543ccf 100644 --- a/entry.c +++ b/entry.c @@ -3,6 +3,8 @@ #include "dir.h&qu

[PATCH v10 4/5] dir_iterator: rewrite state machine model

2017-04-19 Thread Daniel Ferreira
. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- dir-iterator.c | 220 ++- dir-iterator.h | 35 +-- refs/files-backend.c | 51 ++ t/helper/test-

[PATCH v10 2/5] remove_subtree(): test removing nested directories

2017-04-19 Thread Daniel Ferreira
() pass the tests. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- t/t2000-checkout-cache-clash.sh | 11 +++ 1 file changed, 11 insertions(+) diff --git a/t/t2000-checkout-cache-clash.sh b/t/t2000-checkout-cache-clash.sh index de3edb5..ac10ba3 100755 --- a/t/t2000-checkout

[PATCH v10 3/5] dir_iterator: refactor dir_iterator_advance

2017-04-19 Thread Daniel Ferreira
Factor out reusable helpers out of dir_iterator_advance(). Make dir_iterator_advance()'s code more legible and allow some behavior to be reusable. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- dir-iterator.c | 66 ++ 1 file c

[PATCH v10 1/5] dir_iterator: add tests for dir_iterator API

2017-04-19 Thread Daniel Ferreira
Create t/helper/test-dir-iterator.c, which prints relevant information about a directory tree iterated over with dir_iterator. Create t/t0065-dir-iterator.sh, which tests that dir_iterator does iterate through a whole directory tree. Signed-off-by: Daniel Ferreira <bnm...@gmail.

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

2017-04-19 Thread Daniel Ferreira
it as t0065 since I figured it would be weird for this patch as a unit to "skip" a number. Once again, thanks for all the time invested in the reviews for this patch. [1]: https://public-inbox.org/git/1491163388-41255-1-git-send-email-bnm...@gmail.com/T/#m187b9e681e3369862ccc6083bbf659

[PATCH v10 5/5] remove_subtree(): reimplement using iterators

2017-04-19 Thread Daniel Ferreira
Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- entry.c | 42 -- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/entry.c b/entry.c index d2b512d..a939432 100644 --- a/entry.c +++ b/entry.c @@ -3,6 +3,8 @@ #include "dir.h&qu

[PATCH v9 4/5] dir_iterator: refactor state machine model

2017-04-17 Thread Daniel Ferreira
r" and "iterate-over-root" modes. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> --- dir-iterator.c | 223 ++- dir-iterator.h | 35 +-- refs/fil

[PATCH v9 5/5] remove_subtree(): reimplement using iterators

2017-04-17 Thread Daniel Ferreira
Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- entry.c | 42 -- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/entry.c b/entry.c index d2b512d..a939432 100644 --- a/entry.c +++ b/entry.c @@ -3,6 +3,8 @@ #include "dir.h&qu

[PATCH v9 2/5] remove_subtree(): test removing nested directories

2017-04-17 Thread Daniel Ferreira
() pass the tests. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- t/t2000-checkout-cache-clash.sh | 11 +++ 1 file changed, 11 insertions(+) diff --git a/t/t2000-checkout-cache-clash.sh b/t/t2000-checkout-cache-clash.sh index de3edb5..ac10ba3 100755 --- a/t/t2000-checkout

[PATCH v9 3/5] dir_iterator: add helpers to dir_iterator_advance

2017-04-17 Thread Daniel Ferreira
Create helpers to dir_iterator_advance(). Make dir_iterator_advance()'s code more legible and allow some behavior to be reusable. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- dir-iterator.c | 65 +- 1 file changed, 42 inse

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

2017-04-17 Thread Daniel Ferreira
traversing challenges on Git. After all, we might want some special behavior depending on what the given `path` is instead of always considering it valid and later behaving as if it was an empty directory. Thanks again for the reviews. Daniel Ferreira (5): dir_iterator: add tests for dir_iterator

[PATCH v9 1/5] dir_iterator: add tests for dir_iterator API

2017-04-17 Thread Daniel Ferreira
Create t/helper/test-dir-iterator.c, which prints relevant information about a directory tree iterated over with dir_iterator. Create t/t0065-dir-iterator.sh, which tests that dir_iterator does iterate through a whole directory tree. Signed-off-by: Daniel Ferreira <bnm...@gmail.

[PATCH v11 3/5] dir_iterator: refactor dir_iterator_advance

2017-04-26 Thread Daniel Ferreira
Factor out reusable helpers out of dir_iterator_advance(). Make dir_iterator_advance()'s code more legible and allow some behavior to be reusable. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- dir-iterator.c | 66 ++ 1 file c

[PATCH v11 5/5] remove_subtree(): reimplement using iterators

2017-04-26 Thread Daniel Ferreira
Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- entry.c | 42 -- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/entry.c b/entry.c index d2b512d..a939432 100644 --- a/entry.c +++ b/entry.c @@ -3,6 +3,8 @@ #include "dir.h&qu

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

2017-04-26 Thread Daniel Ferreira
eate 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

[PATCH v11 1/5] dir_iterator: add tests for dir_iterator API

2017-04-26 Thread Daniel Ferreira
Create t/helper/test-dir-iterator.c, which prints relevant information about a directory tree iterated over with dir_iterator. Create t/t0066-dir-iterator.sh, which tests that dir_iterator does iterate through a whole directory tree. Signed-off-by: Daniel Ferreira <bnm...@gmail.

[PATCH v11 4/5] dir_iterator: rewrite state machine model

2017-04-26 Thread Daniel Ferreira
. Signed-off-by: Michael Haggerty <mhag...@alum.mit.edu> Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- dir-iterator.c | 212 ++- dir-iterator.h | 35 +-- refs/files-backend.c | 15 ++- t/helper/test-d

[PATCH v11 2/5] remove_subtree(): test removing nested directories

2017-04-26 Thread Daniel Ferreira
() pass the tests. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- t/t2000-checkout-cache-clash.sh | 11 +++ 1 file changed, 11 insertions(+) diff --git a/t/t2000-checkout-cache-clash.sh b/t/t2000-checkout-cache-clash.sh index de3edb5..ac10ba3 100755 --- a/t/t2000-checkout

[PATCH v2 1/4] diff: export diffstat interface

2017-05-15 Thread Daniel Ferreira
from how the show_* functions used by diff_flush() do it. One example is the builtin implementation of git-add--interactive's status. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- diff.c | 17 + diff.h | 19 ++- 2 files changed, 19 insertions(+), 17 del

[PATCH v2 2/4] add--helper: create builtin helper for interactive add

2017-05-15 Thread Daniel Ferreira
). Additionally, an eventual complete port of git-add--interactive would remove the last "big" Git script to have Perl as a dependency, allowing most Git users to have a NOPERL build running without big losses. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- .gitignore

[PATCH v2 3/4] add--helper: implement interactive status command

2017-05-15 Thread Daniel Ferreira
the numstat and use a combination of a hashmap and qsort() to print the result in O(n) + O(n lg n) complexity. This is the first add--interactive command implemented in C of those anticipated by 6cbc52d ("add--helper: create builtin helper for interactive add", 2017-05-15). Signed-off-

[PATCH v2 4/4] add--interactive: use add-interactive--helper for status_cmd

2017-05-15 Thread Daniel Ferreira
Call the newly introduced git-add-interactive--helper builtin on status_cmd() instead of relying on git-add--interactive's Perl functions to build print the numstat. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- git-add--interactive.perl | 4 +--- 1 file changed, 1 insertion

[PATCH v2 0/4] Port git-add--interactive.perl:status_cmd to C

2017-05-15 Thread Daniel Ferreira
me insight on this issue that I could bring to this series. I do think this would be a good idea, though! :) -- Daniel. Daniel Ferreira (4): diff: export diffstat interface add--helper: create builtin helper for interactive add add--helper: implement interactive status command add--interactiv

Implementation of sorted hashmap iteration

2017-05-15 Thread Daniel Ferreira
--- Hi there! When implementing a patch series to port git-add--interactive from Perl to C[1] I ended up implementing this quirk to iterate through a hashmap in the order elements were added to it. In the end, it did not make it into the series but I figured I'd share it anyway if it interests

[PATCH 1/3] diff: export diffstat interface

2017-05-05 Thread Daniel Ferreira
from how the show_* functions used by diff_flush() do it. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- diff.c | 17 + diff.h | 19 ++- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/diff.c b/diff.c index 74283d9..7c073c2 100644 --- a/

[PATCH 0/3] Port git-add--interactive.perl:status_cmd to C

2017-05-05 Thread Daniel Ferreira
o use that and build our status_cmd output. Unless this breaks some rule of Git's API design, the result seems pretty reasonable to me. Travis CI build: https://travis-ci.org/theiostream/git/builds/229232202 Looking forward for feedback, Daniel. Daniel Ferreira (3): diff: export diffstat interfac

[PATCH 3/3] add--interactive: use add-interactive--helper for status_cmd

2017-05-05 Thread Daniel Ferreira
Call the newly introduced git-add-interactive--helper builtin on status_cmd() instead of relying on git-add--interactive's Perl functions to build print the numstat. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- git-add--interactive.perl | 4 +--- 1 file changed, 1 insertion

[PATCH 2/3] add--interactive: add builtin helper for interactive add

2017-05-05 Thread Daniel Ferreira
ithout big losses. Signed-off-by: Daniel Ferreira <bnm...@gmail.com> --- .gitignore| 1 + Makefile | 1 + builtin.h | 1 + builtin/add-interactive--helper.c | 258 +

Re: [PATCH] [GSoC] remove_subtree(): reimplement using iterators

2017-03-24 Thread Daniel Ferreira (theiostream)
> On Fri, Mar 24, 2017 at 2:02 PM, Stefan Beller wrote: > Welcome to the Git community! Thank you! > Please use a more imperative style. (e.g. s/Uses/Use/ ... > s/and simplfying/which simplifies/) Thank you. Will do in a second version of this patch. > Thanks for this

Re: [PATCH v2] [GSoC] remove_subtree(): reimplement using iterators

2017-03-25 Thread Daniel Ferreira (theiostream)
...@gmail.com> wrote: > On Sat, Mar 25, 2017 at 6:27 PM, Daniel Ferreira <bnm...@gmail.com> wrote: >> Use dir_iterator to traverse through remove_subtree()'s directory tree, >> avoiding the need for recursive calls to readdir(). Simplify >> remove_subtree()'s code. >>

Re: [PATCH v5 4/6] dir_iterator: add tests for dir_iterator API

2017-03-30 Thread Daniel Ferreira (theiostream)
On Thu, Mar 30, 2017 at 4:46 AM, Michael Haggerty wrote: > Is there a special reason to write the date to the file as opposed to, say > > touch dir/b > > ? (Some people use `: >dir/b` for this purpose, though I've never found > out why.) If you write the date to the

Re: [PATCH v5 4/6] dir_iterator: add tests for dir_iterator API

2017-03-30 Thread Daniel Ferreira (theiostream)
On Thu, Mar 30, 2017 at 5:05 AM, Michael Haggerty wrote: > Oh I forgot to mention, in the Git project we don't allow declarations > to be mixed with code. Apparently there's some ancient compiler > somewhere that doesn't allow it. Declarations always have to be > together,

Re: [GSoC] Proposal: turn git-add--interactive.perl into a builtin

2017-03-31 Thread Daniel Ferreira (theiostream)
/1dvF2PNRQvvZ351jCdKzOLs7tzaDqhR7ci7TDgzYQg9I/edit?usp=sharing. -- Daniel. On Fri, Mar 31, 2017 at 2:07 AM, Daniel Ferreira (theiostream) <bnm...@gmail.com> wrote: > Hi Stefan & Johannes, > > Thank you for the precious feedback on the proposal. I don't see much > sense in sending a full "

[GSoC] Proposal: turn git-add--interactive.perl into a builtin

2017-03-25 Thread Daniel Ferreira (theiostream)
below), but in case of being accepted I am willing to quit my job some months early to dedicate myself fully to GSoC starting June. BIOGRAPHICAL INFORMATION My name is Daniel Ferreira and I'm a student from São Paulo, Brazil. I was accepted by Stanford University last year and I will start college

Re: [PATCH v7 4/5] dir_iterator: refactor state machine model

2017-04-03 Thread Daniel Ferreira (theiostream)
On Mon, Apr 3, 2017 at 12:36 AM, Michael Haggerty wrote: > As far as I can tell, you got the logic in this complicated big loop > correct on the first try (well, if we ignore v6 :-) ), even as you added > new features. I think that's good evidence that the new structure is >

Re: [PATCH v4 2/5] dir_iterator: iterate over dir after its contents

2017-04-01 Thread Daniel Ferreira (theiostream)
Why exactly would it not be applicable to read_directory_recursively()? On Thu, Mar 30, 2017 at 8:08 AM, Duy Nguyen wrote: > On Thu, Mar 30, 2017 at 1:39 PM, Michael Haggerty > wrote: >> * DIR_ITERATOR_RECURSE -- recurse into subdirectories >> >> would

Re: [PATCH v6 4/5] dir_iterator: refactor state machine model

2017-04-01 Thread Daniel Ferreira (theiostream)
Gah, I just realized I failed to correct refs/files-backend.c's behavior and kept 0 instead of DIR_ITERATOR_PRE_ORDER_TRAVERSAL as its flag. I'll correct this on a v7, but I'll wait for the rest of your reviews before sending that revision. On Sun, Apr 2, 2017 at 1:35 AM, Daniel Ferreira <

Re: [GSoC] Proposal: turn git-add--interactive.perl into a builtin

2017-03-30 Thread Daniel Ferreira (theiostream)
> >> On Sat, Mar 25, 2017 at 8:15 PM, Daniel Ferreira (theiostream) >> <bnm...@gmail.com> wrote: >> >> > SYNOPSIS >> > There are many advantages to converting parts of git that are still >> > scripts to C builtins, among which execution speed,

Re: [GSoC] Proposal: turn git-add--interactive.perl into a builtin

2017-04-02 Thread Daniel Ferreira (theiostream)
On Sun, Apr 2, 2017 at 4:43 PM, Johannes Schindelin wrote: > We ask to accomplish a microproject before evaluating the proposals for > one reason: to have a good understanding how well the students would > interact with the project if they were accepted. As such, the >

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

2017-04-12 Thread Daniel Ferreira (theiostream)
it.) -- Daniel. On Wed, Apr 5, 2017 at 10:39 PM, Daniel Ferreira <bnm...@gmail.com> wrote: > 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-inb

Re: What's cooking in git.git (May 2017, #08; Mon, 29)

2017-05-30 Thread Daniel Ferreira (theiostream)
On Mon, May 29, 2017 at 3:23 AM, Junio C Hamano wrote: > * df/dir-iter-remove-subtree (2017-05-29) 5 commits > . remove_subtree(): reimplement using iterators > . dir_iterator: rewrite state machine model > . dir_iterator: refactor dir_iterator_advance > . remove_subtree():

Re: [PATCH 0/3] Port git-add--interactive.perl:status_cmd to C

2017-05-05 Thread Daniel Ferreira (theiostream)
On Fri, May 5, 2017 at 7:38 PM, Johannes Schindelin wrote: > But maybe you want to keep the naming a little more consistent with the > Perl script, e.g. instead of calling the function `print_modified()` call > it already `list()` (and rename it later to

Re: [PATCH 2/3] add--interactive: add builtin helper for interactive add

2017-05-05 Thread Daniel Ferreira (theiostream)
On Fri, May 5, 2017 at 7:30 PM, Johannes Schindelin wrote: >> +static int git_add_interactive_config(const char *var, > > Not git_add_interactive__helper_config()? ;-) I don't get if you mean this ironically (because of the verbosity) or if you do think this would be

[RFC] [GSoC] Port git-add--interactive.perl:status_cmd to C

2017-05-01 Thread Daniel Ferreira (theiostream)
Hey there, So, in the GSoC proposal I sent about porting git-add--interactive to C[1], I expected I would be able to do a couple of small patches to git-add to familiarize myself with the Git API and have a better clue of how the porting process would go by. Due to the unexpected size my