Thread (119 messages) 119 messages, 15 authors, 2021-09-27

Re: [PATCH v4 1/4] cache.h: Introduce a generic "xdg_config_home_for(…)" function

From: Đoàn Trần Công Danh <hidden>
Date: 2021-05-24 12:23:39

On 2021-05-24 10:33:30+0100, Phillip Wood [off-list ref] wrote:
Hi Lénaïc

This looks fine to me. I'm not 100% sold on calling the parameter prog as
our program name later in the series ends up being "systemd/user" so
something like "subdir" might have been better but that is not worth
rerolling for.
I'll take the blame for that "prog".
I didn't think very hard at the time of writing :(

Yes, "subdir" is definitely better.
And it's aligned with the XDG Base Directory specifications:

	A user-specific version of the configuration file may be
	created in $XDG_CONFIG_HOME/subdir/filename
On 24/05/2021 08:15, Lénaïc Huard wrote:
quoted
Current implementation of `xdg_config_home(filename)` returns
`$XDG_CONFIG_HOME/git/$filename`, with the `git` subdirectory inserted
between the `XDG_CONFIG_HOME` environment variable and the parameter.

This patch introduces a `xdg_config_home_for(prog, filename)` function
which is more generic. It only concatenates "$XDG_CONFIG_HOME", or
"$HOME/.config" if the former isn’t defined, with the parameters,
without adding `git` in between.

`xdg_config_home(filename)` is now implemented by calling
`xdg_config_home_for("git", filename)` but this new generic function can
be used to compute the configuration directory of other programs.
-- 
Danh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help