From: Matheus Tavares Bernardino <matheus.bernardino@usp.br>
To: Thomas Gummerer <t.gummerer@gmail.com>
Cc: git <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>
Subject: Re: [GSoC][PATCH 2/2] clone: use dir-iterator to avoid explicit dir traversal
Date: Thu, 21 Feb 2019 01:46:30 -0300 [thread overview]
Message-ID: <CAHd-oW6VPrHMo1QjAXn6G8P_gmJOQ91LVO+UDK1a8T7uhuM9uQ@mail.gmail.com> (raw)
In-Reply-To: <20190219234506.GL6085@hank.intra.tgummerer.com>
Ok, I think I'm almost there and I should be able to send a v2 on the
weekend. But again, a few questions arose while I'm coding v2. Please,
see inline.
On Tue, Feb 19, 2019 at 8:45 PM Thomas Gummerer <t.gummerer@gmail.com> wrote:
>
> On 02/19, Matheus Tavares Bernardino wrote:
> > Ok, I agree. I noticed copy_or_link_directory only skips hidden
> > directories, not hidden files. And I couldn't think why we would want
> > to skip one but not the other... Could that be unintentional? I mean,
> > maybe the idea was to skip just "." and ".."? If that is the case, I
> > don't even need to make an if check at copy_or_link_directory, since
> > dir-iterator already skips "." and "..". What do you think about that?
[...]
> I feel like you are probably right in that it could be unintentional,
> and I don't think anyone should be messing with the objects
> directory. However that is no guarantee that changing this wouldn't
> break *something*.
>
> For the purpose of this change I would try to keep the same behaviour
> as we currently have where possible, to not increase the scope too
> much.
>
I understand your point, but to make copy_or_link_directory() skip
just hidden directories using dir-iterator seems, now, a little
tricker than I though before. The "if (iter->basename[0] != '.')"
statement in the patch I sent for v1 only skips the hidden directories
creation, but it does not avoid the attempt to copy the hidden
directory contents (which would obviously fail). If we were to do
that, we would need to check every directory in the relative path
string of each iteration entry looking for a hidden directory. That
seems a little too much, IMHO. Because of that and the intuition that
skipping over hidden dirs was an unintentional operation, I think we
could modify copy_or_link_directory() to skip '.' and '..', only.
Also, hidden dirs/files are not expected to be at .git/objects anyway,
are they?
And to have copy_or_link_directory()'s behaviour changed as little as
possible, I could add the option to not follow hidden paths (dirs and
regular files) at dir-iterator.c and use it at
copy_or_link_directory() (now that I'm adding the 'pedantic' option,
this won't be so difficult, anyway). Would these suggestions be a good
plan?
Thanks,
Matheus Tavares
next prev parent reply other threads:[~2019-02-21 4:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-15 15:49 [GSoC][PATCH 0/2] clone: convert explicit traversal to Matheus Tavares
2019-02-15 15:49 ` [GSoC][PATCH 1/2] clone: extract function from copy_or_link_directory Matheus Tavares
2019-02-16 6:23 ` Christian Couder
2019-02-18 21:28 ` Matheus Tavares Bernardino
2019-02-15 15:49 ` [GSoC][PATCH 2/2] clone: use dir-iterator to avoid explicit dir traversal Matheus Tavares
2019-02-16 6:41 ` Christian Couder
2019-02-16 14:38 ` Thomas Gummerer
2019-02-18 21:13 ` Matheus Tavares Bernardino
2019-02-18 23:35 ` Thomas Gummerer
2019-02-19 16:23 ` Matheus Tavares Bernardino
2019-02-19 23:45 ` Thomas Gummerer
2019-02-21 4:46 ` Matheus Tavares Bernardino [this message]
2019-02-21 21:25 ` Thomas Gummerer
[not found] ` <CAMy9T_GzgPPMFLrPNbtf4zaYtyCoUDjXQbd2z8JeXFYogvfrVQ@mail.gmail.com>
2019-02-22 0:22 ` Daniel Ferreira (theiostream)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHd-oW6VPrHMo1QjAXn6G8P_gmJOQ91LVO+UDK1a8T7uhuM9uQ@mail.gmail.com \
--to=matheus.bernardino@usp.br \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=t.gummerer@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).