From: Stefan Beller <sbeller@google.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Schindelin <johannes.schindelin@gmx.de>,
Paul Tan <pyokagan@gmail.com>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCH 1/7] path.c: implement xdg_config_home()
Date: Tue, 14 Apr 2015 15:28:14 -0700 [thread overview]
Message-ID: <CAGZ79kaO_1QMMTY0ni9k3hrkrt_PhqRDRzXkhZEiYuJ0EsE9Tw@mail.gmail.com> (raw)
In-Reply-To: <xmqqzj6a1m3c.fsf@gitster.dls.corp.google.com>
On Tue, Apr 14, 2015 at 1:39 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Johannes Schindelin <johannes.schindelin@gmx.de> writes:
>
>>> diff --git a/cache.h b/cache.h
>>> index 3d3244b..7f9bab0 100644
>>> --- a/cache.h
>>> +++ b/cache.h
>>> @@ -836,6 +836,13 @@ char *strip_path_suffix(const char *path, const
>>> char *suffix);
>>> int daemon_avoid_alias(const char *path);
>>> extern int is_ntfs_dotgit(const char *name);
>>>
>>> +/**
>>> + * Returns the newly allocated string "$XDG_CONFIG_HOME/git/%s". If
>>> + * $XDG_CONFIG_HOME is unset or empty, returns the newly allocated string
>>> + * "$HOME/.config/git/%s". Returns NULL if an error occurred.
>>> + */
>>> +extern char *xdg_config_home(const char *fn);
>>
>> Should this not be inserted close to home_config_paths()? Also, the
>> name "fn" sounds more like "function" than like "filename" to me,
>> especially keeping the name `config_fn_t` in mind. Maybe call the
>> parameter "filename" to avoid confusion?
>
> It is OK to omit the name in the extern declaration here. We have
> to have a sensible variable name in the definition in path.c, of
> course ;-), and "filename" sounds like a very sensible suggestion.
>
It is OK, but I think this is bad practice.
Have a look at strbuf.h, there you'll find:
extern int strbuf_getwholeline_fd(struct strbuf *, int, int);
It's not clear what the 2 ints are, probably a fd and a max size?
Even if guessed correctly, you'd still need another guess for the order.
next prev parent reply other threads:[~2015-04-14 22:28 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-12 7:46 [PATCH 1/7] path.c: implement xdg_config_home() Paul Tan
2015-04-12 7:46 ` [PATCH 2/7] attr.c: replace home_config_paths() with xdg_config_home() Paul Tan
2015-04-12 7:46 ` [PATCH 3/7] dir.c: " Paul Tan
2015-04-12 7:46 ` [PATCH 4/7] credential-store.c: " Paul Tan
2015-04-12 7:46 ` [PATCH 5/7] git-commit: replace use of home_config_paths() Paul Tan
2015-04-12 7:46 ` [PATCH 6/7] git-config: " Paul Tan
2015-04-12 7:46 ` [PATCH 7/7] path.c: remove home_config_paths() Paul Tan
2015-04-13 15:50 ` [PATCH 1/7] path.c: implement xdg_config_home() Johannes Schindelin
2015-04-14 17:28 ` [PATCH v2 " Paul Tan
2015-04-16 21:41 ` Eric Sunshine
2015-04-18 7:51 ` Paul Tan
2015-04-20 0:39 ` Eric Sunshine
2015-04-21 4:06 ` [PATCH v3 " Paul Tan
2015-05-06 8:00 ` [PATCH v3 2/7] attr.c: replace home_config_paths() with xdg_config_home() Paul Tan
2015-05-06 8:01 ` [PATCH v3 3/7] dir.c: " Paul Tan
2015-05-06 8:01 ` [PATCH v3 4/7] credential-store.c: " Paul Tan
2015-05-06 8:01 ` [PATCH v3 5/7] git-commit: replace use of home_config_paths() Paul Tan
2015-05-06 8:01 ` [PATCH v3 6/7] git-config: " Paul Tan
2015-05-06 8:01 ` [PATCH v3 7/7] path.c: remove home_config_paths() Paul Tan
2015-04-18 8:48 ` [PATCH v2 1/7] path.c: implement xdg_config_home() Paul Tan
2015-04-14 20:39 ` [PATCH " Junio C Hamano
2015-04-14 22:28 ` Stefan Beller [this message]
2015-04-14 22:30 ` Junio C Hamano
2015-04-14 22:34 ` Stefan Beller
2015-04-13 21:43 ` Matthieu Moy
2015-04-14 0:18 ` Stefan Beller
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=CAGZ79kaO_1QMMTY0ni9k3hrkrt_PhqRDRzXkhZEiYuJ0EsE9Tw@mail.gmail.com \
--to=sbeller@google.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=johannes.schindelin@gmx.de \
--cc=pyokagan@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).