From: Junio C Hamano <gitster@pobox.com>
To: Miriam Rubio <mirucam@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [Outreachy] [PATCH] clone: rename static function `dir_exists()`.
Date: Tue, 29 Oct 2019 12:03:04 +0900 [thread overview]
Message-ID: <xmqqimo86yon.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20191028165523.84333-1-mirucam@gmail.com> (Miriam Rubio's message of "Mon, 28 Oct 2019 17:55:23 +0100")
Miriam Rubio <mirucam@gmail.com> writes:
> builtin/clone.c has a static function dir_exists() that
> checks if a given path exists on the filesystem. It returns
> true (and it is correct for it to return true) when the
> given path exists as a non-directory (e.g. a regular file).
>
> This is confusing. What the caller wants to check, and what
> this function wants to return, is if the path exists, so
> rename it to path_exists().
>
> Signed-off-by: Miriam Rubio <mirucam@gmail.com>
> ---
> builtin/clone.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
With a narrowed scope, the patch and its explanation are both
perfect ;-)
Now, with this localized change behind us, we may want to consider
what to do with file_exists(path) that does not ensure the path is a
file. It would be a separate topic, and it is OK for the result
after such consideration to be "let's not go further for now". It
also is OK for it to be "I am interested in digging further", too.
Thanks. Will queue.
next prev parent reply other threads:[~2019-10-29 3:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-28 16:55 [Outreachy] [PATCH] clone: rename static function `dir_exists()` Miriam Rubio
2019-10-29 3:03 ` Junio C Hamano [this message]
2019-10-29 20:14 ` 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=xmqqimo86yon.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=mirucam@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).