Re: [PATCH v2 02/21] path.c: rename vsnpath() to git_vsnpath()
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Dec 16, 2013, 17:11 UTC
- Message-ID
- <20131216171147.GA28604@google.com>
- In-Reply-To
- <CACsJy8AJT5XXyJvVi_6Gjrn=AqA1M9KWY_62p=d3CPjg7nXFWw@mail.gmail.com>
Duy Nguyen wrote:
>>> Ramsay Jones wrote:
>>>> :-D I renamed this _from_ git_vsnpath() in commit 5b3b8fa2 ("path.c: Remove the
>>>> 'git_' prefix from a file scope function", 04-09-2012), because ... well it's a
>>>> file scope function! (i.e. the git_ prefix implies greater than file scope).
>>>> I'm not very good at naming things, so ...[...]
> OK I go with this. I think it makes sense > > vsnpath -> do_git_path
I think this renaming would be still losing clarity --- it loses the information that this is the vsnprintf-like variant of git_path.
Do we actually have a convention that functions with git_ prefix should be global? If git_path were not global, would it have to be renamed? If git_vsnpath should be renamed to avoid mistaking it for git's replacement of a hypothetical standard library vsnpath function, shouldn't git_path, git_pathdup, etc be renamed for the same reason as well?
Show 5 quoted lines
> its three callers are > > git_vsnpath -> strbuf_git_path (it's updated to take strbuf) > git_path > git_pathdup
Yeah, independently of everything else, a strbuf variant sounds nice.
Thanks, Jonathan