From: Junio C Hamano <gitster@pobox.com>
To: Brandon Williams <bmwill@google.com>
Cc: git@vger.kernel.org, sunshine@sunshineco.com
Subject: Re: [PATCH] path: document path functions
Date: Wed, 13 Dec 2017 11:14:12 -0800 [thread overview]
Message-ID: <xmqqr2rywid7.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20171213182802.114615-1-bmwill@google.com> (Brandon Williams's message of "Wed, 13 Dec 2017 10:28:02 -0800")
Brandon Williams <bmwill@google.com> writes:
> Signed-off-by: Brandon Williams <bmwill@google.com>
> ---
>
> As promised here is an update to the documentation for the path generating
> functions.
>
> path.h | 133 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------
> 1 file changed, 112 insertions(+), 21 deletions(-)
>
> diff --git a/path.h b/path.h
> index 9541620c7..1ccd0373c 100644
> --- a/path.h
> +++ b/path.h
> @@ -4,53 +4,144 @@
> struct repository;
>
> /*
> - * Return a statically allocated filename, either generically (mkpath), in
> - * the repository directory (git_path), or in a submodule's repository
> - * directory (git_path_submodule). In all cases, note that the result
> - * may be overwritten by another call to _any_ of the functions. Consider
> - * using the safer "dup" or "strbuf" formats below (in some cases, the
> - * unsafe versions have already been removed).
> + * The result to all functions which return statically allocated memory may be
> + * overwritten by another call to _any_ one of these functions. Consider using
> + * the safer variants which operate on strbufs or return allocated memory.
> */
The result of the update definitely is better, but stepping back a
bit, it still does not answer some questions the original did not:
- is the resulting path absolute? if relative, relative to what (cwd)?
- what should a caller write in fmt? can we have a couple of
typical calling example?
- does a caller need to know which hierarchies under $GIT_DIR are
common and call git_common_path() for them, or does git_path()
do the 'right' thing for the caller? If latter, what's the use
of git_common_path() for callers (outside the implementation of
path.c API)?
Will queue. Thanks.
next prev parent reply other threads:[~2017-12-13 19:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-11 23:16 [PATCH] clone: support 'clone --shared' from a worktree Eric Sunshine
2017-12-12 0:01 ` Junio C Hamano
2017-12-12 0:18 ` Brandon Williams
2017-12-12 0:40 ` Eric Sunshine
2017-12-12 0:52 ` Brandon Williams
2017-12-13 18:28 ` [PATCH] path: document path functions Brandon Williams
2017-12-13 19:14 ` Junio C Hamano [this message]
2017-12-20 8:58 ` Eric Sunshine
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=xmqqr2rywid7.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=bmwill@google.com \
--cc=git@vger.kernel.org \
--cc=sunshine@sunshineco.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.