From: Junio C Hamano <gitster@pobox.com>
To: Phil Hord <hordp@cisco.com>
Cc: "git\@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCH] Make is_gitfile a non-static generic function
Date: Tue, 11 Oct 2011 16:26:20 -0700 [thread overview]
Message-ID: <7vsjmzcdpf.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4E94C8AB.3040807@cisco.com> (Phil Hord's message of "Tue, 11 Oct 2011 18:52:27 -0400")
Phil Hord <hordp@cisco.com> writes:
> I'm not sure this function belongs in transport.c anymore, but
> I left it here to minimize conflicts. I think a better home would
> be path.c, but maybe not. If someone has a preference,
> please let me know.
I would think either transport.c or setup.c is more appropriate than
path.c; the last one is more of "pathname manipulation utility bag of
functions" and does not have much to do with the "Git"-ness of the path
they deal with.
I am not sure if is_gitfile() is a good name for a global function,
though. Also I think the interface to the function should be updated so
that the caller can choose to receive the target path when the function
returns with positive answer, making "read_gitfile()" unnecessary for such
a caller.
As a matter of fact, couldn't we somehow unify these two slightly
different implementations around the same theme, making is_gitfile()
function unnecessary? As far as I can tell, the only difference between
these functions is how they fail when given a non-gitfile, and many
callers just call read_gitfile() without first asking if it is a gitfile.
next prev parent reply other threads:[~2011-10-11 23:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <4E94C70E.3080003@cisco.com>
2011-10-11 22:52 ` [PATCH] Make is_gitfile a non-static generic function Phil Hord
2011-10-11 23:26 ` Junio C Hamano [this message]
2011-10-11 23:45 ` Junio C Hamano
2011-10-12 13:29 ` Phil Hord
2011-10-12 18:01 ` Phil Hord
2011-10-12 18:08 ` Junio C Hamano
2011-10-12 19:47 ` Phil Hord
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=7vsjmzcdpf.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=hordp@cisco.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).