{"thread":{"id":"36207","subject":"[PATCH v2] Documentation/gitk: Document new config file location","startedAt":"2014-03-18T17:53:07Z","lastAt":"2014-03-18T20:07:56Z","messageCount":2,"participants":["Astril Hayato","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"236992","messageId":"1395165187-3629-1-git-send-email-astrilhayato@gmail.com","threadId":"36207","inReplyTo":null,"subject":"[PATCH v2] Documentation/gitk: Document new config file location","fromName":"Astril Hayato","fromEmail":"astrilhayato@gmail.com","sentAt":"2014-03-18T17:53:07Z","receivedAt":"2014-03-18T17:53:07Z","isPatch":true,"sender":{"key":"astrilhayato@gmail.com","avatar":null},"body":"User config file location now complies with XDG base directory specification\n\nSigned-off-by: Astril Hayato <astrilhayato@gmail.com>\n---\n Documentation/gitk.txt | 9 +++++++--\n 1 file changed, 7 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/gitk.txt b/Documentation/gitk.txt\nindex 1e9e38a..c2aa514 100644\n--- a/Documentation/gitk.txt\n+++ b/Documentation/gitk.txt\n@@ -166,8 +166,13 @@ gitk --max-count=100 --all \\-- Makefile::\n \n Files\n -----\n-Gitk creates the .gitk file in your $HOME directory to store preferences\n-such as display options, font, and colors.\n+User configuration and preferences are stored at (in order of priority):\n+\n+* '$XDG_CONFIG_HOME/git/gitk' if it exists and '$XDG_CONFIG_HOME' is set\n+* '$HOME/.config/git/gitk' if it exists\n+* '$HOME/.gitk' if it exists\n+\n+If none of the above exist then '$HOME/.config/git/gitk' is created and used by default.\n \n History\n -------\n-- \n1.9.0\n"},{"id":"237009","messageId":"xmqqr45z6zj7.fsf@gitster.dls.corp.google.com","threadId":"36207","inReplyTo":"1395165187-3629-1-git-send-email-astrilhayato@gmail.com","subject":"Re: [PATCH v2] Documentation/gitk: Document new config file location","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-03-18T20:07:56Z","receivedAt":"2014-03-18T20:07:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Astril Hayato <astrilhayato@gmail.com> writes:\n\n> User config file location now complies with XDG base directory specification\n>\n> Signed-off-by: Astril Hayato <astrilhayato@gmail.com>\n> ---\n>  Documentation/gitk.txt | 9 +++++++--\n>  1 file changed, 7 insertions(+), 2 deletions(-)\n>\n> diff --git a/Documentation/gitk.txt b/Documentation/gitk.txt\n> index 1e9e38a..c2aa514 100644\n> --- a/Documentation/gitk.txt\n> +++ b/Documentation/gitk.txt\n> @@ -166,8 +166,13 @@ gitk --max-count=100 --all \\-- Makefile::\n>  \n>  Files\n>  -----\n> -Gitk creates the .gitk file in your $HOME directory to store preferences\n> -such as display options, font, and colors.\n> +User configuration and preferences are stored at (in order of priority):\n> +\n> +* '$XDG_CONFIG_HOME/git/gitk' if it exists and '$XDG_CONFIG_HOME' is set\n> +* '$HOME/.config/git/gitk' if it exists\n> +* '$HOME/.gitk' if it exists\n> +\n> +If none of the above exist then '$HOME/.config/git/gitk' is created and used by default.\n\nThe last line is a bit of a lie, isn't it?\n\nIf XDG_CONFIG_HOME is set to an non-empty string, config_file is set\nto $XDG_CONFIG_HOME/git/gitk.  Otherwise config_file is set to\n$HOME/.config/git/gitk.\n\nAfter that happens:\n\n - if that file exists, it is used;\n\n - otherwise:\n\n   . if $HOME/.gitk exists, we use it (in other words, $HOME/.gitk\n     is never used unless the user is an old timer who has one);\n\n   . if $HOME/.gitk does not exist (in other words, if none of the\n     above exists), then an empty $config_file is created and used.\n\nWe use either $HOME/.config/git/gitk or $XDG_CONFIG_HOME/git/gitk\nand never $HOME/.gitk when none of the above exists, and the choice\nbetween the two depends on XDG_CONFIG_HOME.\n\nI'll queue this patch as-is, but we may want to further clarify with\na follow-up patch.\n\nThanks.\n"}]}