# Want to start contributing to git through this task: "Use dir-iterator to avoid explicit recursiv

3 messages from 2018-04-09 to 2018-04-10. Participants: vaibhav kurhe, Eric Sunshine, Johannes Schindelin.
Thread: https://gitlist.dev/t/48251

## vaibhav kurhe, 2018-04-09 13:51

Subject: Want to start contributing to git through this task: "Use dir-iterator to avoid explicit recursiv
Message-ID: <CAHKv1qs-cnmcd2pR9iv=Xx1aKnb=SEsCQ7OAjy-4yHhCE_e_dw@mail.gmail.com>
URL: https://gitlist.dev/e/CAHKv1qs-cnmcd2pR9iv%3DXx1aKnb%3DSEsCQ7OAjy-4yHhCE_e_dw%40mail.gmail.com

```
Hello all,
I am a Git user since last 2 years and now I want to contribute
towards its development.
Yesterday, I had a discussion with Kevin on the IRC channel
#git-devel, where I got this link:-
https://git.github.io/SoC-2018-Microprojects/.
Out of the tasks listed down in above URL, I found this one interesting:-
"Use dir-iterator to avoid explicit recursive directory traversal"
==>
Some places in git use raw API opendir/readdir/closedir to traverse a
directory recursively, which usually involves function recursion. Now
that we have struct dir_iterator (see dir-iterator.h), convert these
to use the dir-iterator to simplify the code. Do only one conversion
per microproject.

I cloned the git repo and browsed through it. I found that in git
clone (buildtin/clone.c), raw directory API readdir() is used
recursively.
So there is a place to change it to use the already available
"dir_iterator" structure.

I just want to know, if anybody is working on this task already.
If not, then I can proceed to work.

Thank you and Regards,
Vaibhav

```

## Eric Sunshine, 2018-04-09 18:05

Subject: Re: Want to start contributing to git through this task: "Use dir-iterator to avoid explicit recursiv
Message-ID: <CAPig+cRNbDBpDn_ku0cXJhzvnrSOkBTztp8tWomePxfXaviotw@mail.gmail.com>
URL: https://gitlist.dev/e/CAPig%2BcRNbDBpDn_ku0cXJhzvnrSOkBTztp8tWomePxfXaviotw%40mail.gmail.com
In-Reply-To: <CAHKv1qs-cnmcd2pR9iv=Xx1aKnb=SEsCQ7OAjy-4yHhCE_e_dw@mail.gmail.com>

```
On Mon, Apr 9, 2018 at 9:51 AM, vaibhav kurhe <vaibhav.kurhe@gmail.com> wrote:
> https://git.github.io/SoC-2018-Microprojects/.
> Out of the tasks listed down in above URL, I found this one interesting:-
> "Use dir-iterator to avoid explicit recursive directory traversal"
> I cloned the git repo and browsed through it. I found that in git
> clone (buildtin/clone.c), raw directory API readdir() is used
> recursively.
> So there is a place to change it to use the already available
> "dir_iterator" structure.
> I just want to know, if anybody is working on this task already.
> If not, then I can proceed to work.

There has been no recent discussion on the mailing list regarding
this, so it is unlikely that anyone else is working on it.

```

## Johannes Schindelin, 2018-04-10 08:41

Subject: Re: Want to start contributing to git through this task: "Use dir-iterator to avoid explicit recursiv
Message-ID: <nycvar.QRO.7.76.6.1804101040090.55@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz>
URL: https://gitlist.dev/e/nycvar.QRO.7.76.6.1804101040090.55%40ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz
In-Reply-To: <CAPig+cRNbDBpDn_ku0cXJhzvnrSOkBTztp8tWomePxfXaviotw@mail.gmail.com>

```
Hi,

On Mon, 9 Apr 2018, Eric Sunshine wrote:

> On Mon, Apr 9, 2018 at 9:51 AM, vaibhav kurhe <vaibhav.kurhe@gmail.com> wrote:
> > https://git.github.io/SoC-2018-Microprojects/.
> > Out of the tasks listed down in above URL, I found this one interesting:-
> > "Use dir-iterator to avoid explicit recursive directory traversal"
> > I cloned the git repo and browsed through it. I found that in git
> > clone (buildtin/clone.c), raw directory API readdir() is used
> > recursively.
> > So there is a place to change it to use the already available
> > "dir_iterator" structure.
> > I just want to know, if anybody is working on this task already.
> > If not, then I can proceed to work.
> 
> There has been no recent discussion on the mailing list regarding
> this, so it is unlikely that anyone else is working on it.

Indeed.

Please feel free to reach out when you get stuck. If you want to show the
code in progress, may I suggest to publish your topic branch to a public
repository, such as on GitHub?

Ciao,
Johannes

```
