Re: [PATCH 1/7] path.c: implement xdg_config_home()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 14, 2015, 20:39 UTC
- Message-ID
- <xmqqzj6a1m3c.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <e1bc6f19af608db796a2212dbf00ba45@www.dscho.org>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 20 quoted lines
>> 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.