From: "Miriam R." <mirucam@gmail.com>
To: git@vger.kernel.org
Cc: Christian Couder <christian.couder@gmail.com>
Subject: Re: [Outreachy][PATCH] abspath: reconcile `dir_exists()` and `is_directory()`
Date: Fri, 25 Oct 2019 10:59:42 +0200 [thread overview]
Message-ID: <CAN7CjDB9mRTNRKRoE8XfLz4in5gV6pxrKrqcjLPfthDHaf20nA@mail.gmail.com> (raw)
In-Reply-To: <xmqqmudpee57.fsf@gitster-ct.c.googlers.com>
Ok, then after discussion, finally the issue tasks would be:
- Add path_exists() that will work same as file_exists(), keeping for
now the latter.
- Use path_exists() instead of dir_exists() in builtin/clone.c.
And also:
- Rename is_directory() to dir_exists(), as it is the equivalent to
path_exists()/file_exists(), isn't it?
Best,
Miriam
El vie., 25 oct. 2019 a las 4:46, Junio C Hamano (<gitster@pobox.com>) escribió:
>
> SZEDER Gábor <szeder.dev@gmail.com> writes:
>
> > The first callsite is:
> >
> > dest_exists = dir_exists(dir);
> > if (dest_exists && !is_empty_dir(dir))
> > die(_("destination path '%s' already exists and is not "
> > "an empty directory."), dir);
>
> Yup. The primary/original reason why the helper exists is to see if
> we can create directory there, so the function is asking "is this
> path taken?" It might have been cleaner to do all of these without
> using such a helper function and instead take the safer approach to
> "try mkdir, and if we fail, complian", which is race-free. But the
> above is what we have now X-<.
>
next prev parent reply other threads:[~2019-10-25 8:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-24 9:27 [Outreachy][PATCH] abspath: reconcile `dir_exists()` and `is_directory()` Miriam Rubio
2019-10-24 11:41 ` SZEDER Gábor
2019-10-24 18:13 ` Jeff King
2019-10-24 20:45 ` Emily Shaffer
2019-10-24 20:51 ` Jeff King
2019-10-25 2:40 ` Junio C Hamano
2019-10-24 20:57 ` Miriam R.
2019-10-25 2:45 ` Junio C Hamano
2019-10-25 8:59 ` Miriam R. [this message]
2019-10-25 9:43 ` Junio C Hamano
2019-10-25 14:47 ` Christian Couder
2019-10-25 15:23 ` Miriam R.
2019-10-26 15:30 ` Miriam R.
2019-10-26 18:05 ` Christian Couder
2019-10-26 18:42 ` Miriam R.
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=CAN7CjDB9mRTNRKRoE8XfLz4in5gV6pxrKrqcjLPfthDHaf20nA@mail.gmail.com \
--to=mirucam@gmail.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
/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).