{"thread":{"id":"31655","subject":"Configuring the location of ~/.gitconfig","startedAt":"2012-09-26T14:14:27Z","lastAt":"2012-09-28T07:05:31Z","messageCount":14,"participants":["Ramkumar Ramachandra","David Aguilar","Junio C Hamano","Anurag Priyam","Matthieu Moy","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"199948","messageId":"CALkWK0nEP2gf4fYL=hjHg_U3X67M4PF1aupV+VJb9T6eBEo0MQ@mail.gmail.com","threadId":"31655","inReplyTo":null,"subject":"Configuring the location of ~/.gitconfig","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2012-09-26T14:14:27Z","receivedAt":"2012-09-26T14:14:27Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Hi,\n\nI'd like to configure the location of ~/.gitconfig through an\nenvironment variable.  My usecase is a simple enough: I have a\nrepository with all my dotfiles, and I don't want to symlink\n~/dotfiles/.gitconfig from $HOME after cloning it.  Does anyone else\nthink the feature will be useful?\n\nA couple of similar examples:\n1. The git templates directory is configurable via the\nGIT_TEMPLATE_DIR variable.\n2. The location of ~/.zshrc, ~/.zlogin etc is configurable via the\nZDOTDIR variable in ZSH.\n\nRam\n"},{"id":"199958","messageId":"CAJDDKr6q1k+nM9VTukLvze2E6wRBrMOHeZRAoAbKp0MbGv4cQQ@mail.gmail.com","threadId":"31655","inReplyTo":"CALkWK0nEP2gf4fYL=hjHg_U3X67M4PF1aupV+VJb9T6eBEo0MQ@mail.gmail.com","subject":"Re: Configuring the location of ~/.gitconfig","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2012-09-26T18:34:05Z","receivedAt":"2012-09-26T18:34:05Z","isPatch":false,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Wed, Sep 26, 2012 at 7:14 AM, Ramkumar Ramachandra\n<artagnon@gmail.com> wrote:\n> Hi,\n>\n> I'd like to configure the location of ~/.gitconfig through an\n> environment variable.  My usecase is a simple enough: I have a\n> repository with all my dotfiles, and I don't want to symlink\n> ~/dotfiles/.gitconfig from $HOME after cloning it.  Does anyone else\n> think the feature will be useful?\n>\n> A couple of similar examples:\n> 1. The git templates directory is configurable via the\n> GIT_TEMPLATE_DIR variable.\n> 2. The location of ~/.zshrc, ~/.zlogin etc is configurable via the\n> ZDOTDIR variable in ZSH.\n\nThere was some work recently to teach git about the XDG_CONFIG_HOME variable.\n\nWould that help, or are the XDG variables too global for your usage?\n-- \nDavid\n"},{"id":"199991","messageId":"7v6270t2tb.fsf@alter.siamese.dyndns.org","threadId":"31655","inReplyTo":"CALkWK0nEP2gf4fYL=hjHg_U3X67M4PF1aupV+VJb9T6eBEo0MQ@mail.gmail.com","subject":"Re: Configuring the location of ~/.gitconfig","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-27T06:09:04Z","receivedAt":"2012-09-27T06:09:04Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> I'd like to configure the location of ~/.gitconfig through an\n> environment variable.  My usecase is a simple enough: I have a\n> repository with all my dotfiles, and I don't want to symlink\n> ~/dotfiles/.gitconfig from $HOME after cloning it.  Does anyone else\n> think the feature will be useful?\n\nNot me. For that particular use case, my approach (long before I\nswitched the vcs that controls my dotfiles to git) have always been\nto have ~/src that is version controlled, with a Makefile that\nbuilds/adjusts dotfiles appropriately for each box and installs them\nin the proper place.\n\nOf course, if .gitconfig _is_ the same across all boxes I use, that\nMakefile is likely to \"install\" by making a symlink ~/.gitconfig\nthat points at src/dot/gitconfig without \"building\".\n"},{"id":"199996","messageId":"CAD1m08Wz7WqP8Yxgc6xuhBSntQ0PS6hGOzHWrcd0VAbARmkuUA@mail.gmail.com","threadId":"31655","inReplyTo":"7v6270t2tb.fsf@alter.siamese.dyndns.org","subject":"Re: Configuring the location of ~/.gitconfig","fromName":"Anurag Priyam","fromEmail":"anurag08priyam@gmail.com","sentAt":"2012-09-27T06:40:01Z","receivedAt":"2012-09-27T06:40:01Z","isPatch":false,"sender":{"key":"anurag08priyam@gmail.com","avatar":null},"body":"On Thu, Sep 27, 2012 at 11:39 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Ramkumar Ramachandra <artagnon@gmail.com> writes:\n>\n>> I'd like to configure the location of ~/.gitconfig through an\n>> environment variable.  My usecase is a simple enough: I have a\n>> repository with all my dotfiles, and I don't want to symlink\n>> ~/dotfiles/.gitconfig from $HOME after cloning it.  Does anyone else\n>> think the feature will be useful?\n>\n> Not me. For that particular use case, my approach (long before I\n> switched the vcs that controls my dotfiles to git) have always been\n> to have ~/src that is version controlled, with a Makefile that\n> builds/adjusts dotfiles appropriately for each box and installs them\n> in the proper place.\n\nMakefile is what I wanted to avoid when I suggested Ram that maybe Git\ncould _optionally_ read the location of global gitconfig from an\nenvironment variable that can be exported in zshenv or bash_profile.\n\nI don't think either way is the best way of managing dotfiles.  Just a\nmatter of preference.  The environment variable approach doesn't\nrequire you to run `make` everytime you sync your dotfiles across\ndifferent machines, and that is what I like.\n\nAlso, Git allows configuring the location of template directory via an\nenvironment variable (GIT_TEMPLATE_DIR).  Since Git has already fixed\nthe location of global gitconfig, it might as well read the location\nof template directory from there (init.templatedir).  Why the added\nflexibility?  Well, I have been exploiting the feature to manage git\ntemplates through my zsh configuration.\n\n-- \nAnurag Priyam\n"},{"id":"199998","messageId":"CALkWK0nYnyaoOsH_x8U96ADZT7VuP-pR36+RRcjTw39Kp1qCnw@mail.gmail.com","threadId":"31655","inReplyTo":"CAJDDKr6q1k+nM9VTukLvze2E6wRBrMOHeZRAoAbKp0MbGv4cQQ@mail.gmail.com","subject":"Re: Configuring the location of ~/.gitconfig","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2012-09-27T06:49:36Z","receivedAt":"2012-09-27T06:49:36Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Hi David,\n\nDavid Aguilar wrote:\n> Would that help, or are the XDG variables too global for your usage?\n\nYeah, they're too global.  I'll write a patch.\n\nRam\n"},{"id":"200012","messageId":"1348757171-3223-1-git-send-email-artagnon@gmail.com","threadId":"31655","inReplyTo":"CALkWK0nYnyaoOsH_x8U96ADZT7VuP-pR36+RRcjTw39Kp1qCnw@mail.gmail.com","subject":"[PATCH] config: introduce GIT_GLOBAL_CONFIG to override ~/.gitconfig","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2012-09-27T14:46:11Z","receivedAt":"2012-09-27T14:46:11Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n Documentation/git-config.txt |    3 +++\n path.c                       |    5 +++++\n t/t1306-xdg-files.sh         |    8 ++++++++\n 3 files changed, 16 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-config.txt b/Documentation/git-config.txt\nindex eaea079..c8db03f 100644\n--- a/Documentation/git-config.txt\n+++ b/Documentation/git-config.txt\n@@ -205,6 +205,9 @@ $GIT_DIR/config::\n \tUser-specific configuration file. Also called \"global\"\n \tconfiguration file.\n \n+$GIT_GLOBAL_CONFIG::\n+\tOverrides the path of the global configuration file.\n+\n $XDG_CONFIG_HOME/git/config::\n \tSecond user-specific configuration file. If $XDG_CONFIG_HOME is not set\n \tor empty, $HOME/.config/git/config will be used. Any single-valued\ndiff --git a/path.c b/path.c\nindex cbbdf7d..9b09cee 100644\n--- a/path.c\n+++ b/path.c\n@@ -131,10 +131,15 @@ char *git_path(const char *fmt, ...)\n \n void home_config_paths(char **global, char **xdg, char *file)\n {\n+\tchar *global_config = getenv(\"GIT_GLOBAL_CONFIG\");\n \tchar *xdg_home = getenv(\"XDG_CONFIG_HOME\");\n \tchar *home = getenv(\"HOME\");\n \tchar *to_free = NULL;\n \n+\tif (global_config) {\n+\t\t*global = mkpathdup(\"%s\", global_config);\n+\t\treturn;\n+\t}\n \tif (!home) {\n \t\tif (global)\n \t\t\t*global = NULL;\ndiff --git a/t/t1306-xdg-files.sh b/t/t1306-xdg-files.sh\nindex 8b14ab1..5b0e08e 100755\n--- a/t/t1306-xdg-files.sh\n+++ b/t/t1306-xdg-files.sh\n@@ -28,6 +28,14 @@ test_expect_success 'read config: xdg file exists and ~/.gitconfig exists' '\n \ttest_cmp expected actual\n '\n \n+test_expect_success 'read config: $GIT_GLOBAL_CONFIG is set and ~/.gitconfig exists' '\n+\t>.gitconfig &&\n+\techo \"[alias]\" >.gittestconfig &&\n+\techo \"\tmyalias = !echo in_gitconfig\" >>.gittestconfig &&\n+\techo in_gitconfig >expected &&\n+\tGIT_GLOBAL_CONFIG=~/.gittestconfig git myalias >actual &&\n+\ttest_cmp expected actual\n+'\n \n test_expect_success 'read with --get: xdg file exists and ~/.gitconfig doesn'\\''t' '\n \trm .gitconfig &&\n-- \n1.7.8.1.362.g5d6df.dirty\n"},{"id":"200017","messageId":"vpq626zjtds.fsf@grenoble-inp.fr","threadId":"31655","inReplyTo":"1348757171-3223-1-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH] config: introduce GIT_GLOBAL_CONFIG to override ~/.gitconfig","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2012-09-27T16:57:35Z","receivedAt":"2012-09-27T16:57:35Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt\n> index eaea079..c8db03f 100644\n> --- a/Documentation/git-config.txt\n> +++ b/Documentation/git-config.txt\n> @@ -205,6 +205,9 @@ $GIT_DIR/config::\n>  \tUser-specific configuration file. Also called \"global\"\n>  \tconfiguration file.\n>  \n> +$GIT_GLOBAL_CONFIG::\n> +\tOverrides the path of the global configuration file.\n> +\n\nI'm not particularly in favor of introducing another environment\nvariable, but if you are to introduce it, why just override the\nconfiguration file, and not $HOME completely (e.g. to override\n$HOME/.git-credentials too).\n\nThere was a patch proposing that here ($GIT_HOME to override $HOME):\n\n  http://thread.gmane.org/gmane.comp.version-control.git/135447/focus=135494\n\nI don't remember exactly what happened to the patch, I can't find an\nexplicit reason to reject it in the thread, but it seems it didn't make\nits way to git.git.\n\n> index cbbdf7d..9b09cee 100644\n> --- a/path.c\n> +++ b/path.c\n> @@ -131,10 +131,15 @@ char *git_path(const char *fmt, ...)\n>  \n>  void home_config_paths(char **global, char **xdg, char *file)\n>  {\n> +\tchar *global_config = getenv(\"GIT_GLOBAL_CONFIG\");\n>  \tchar *xdg_home = getenv(\"XDG_CONFIG_HOME\");\n>  \tchar *home = getenv(\"HOME\");\n>  \tchar *to_free = NULL;\n>  \n> +\tif (global_config) {\n> +\t\t*global = mkpathdup(\"%s\", global_config);\n> +\t\treturn;\n> +\t}\n\nIf you return here, haven't you completely broken the XDG stuff, since\n*xdg is set a few lines below in the function?\n\nAlso, I guess home_config_paths(..., \"ignore\") will return the path to\nthe configuration file instead of the ignore file?\n\n> --- a/t/t1306-xdg-files.sh\n> +++ b/t/t1306-xdg-files.sh\n> @@ -28,6 +28,14 @@ test_expect_success 'read config: xdg file exists and ~/.gitconfig exists' '\n>  \ttest_cmp expected actual\n>  '\n>  \n> +test_expect_success 'read config: $GIT_GLOBAL_CONFIG is set and ~/.gitconfig exists' '\n> +\t>.gitconfig &&\n> +\techo \"[alias]\" >.gittestconfig &&\n> +\techo \"\tmyalias = !echo in_gitconfig\" >>.gittestconfig &&\n> +\techo in_gitconfig >expected &&\n> +\tGIT_GLOBAL_CONFIG=~/.gittestconfig git myalias >actual &&\n> +\ttest_cmp expected actual\n> +'\n\nYou should check that \"git config --set\" works too, as the codepath for\nwriting to configuration is relatively different from the one to read.\nFor example, I *think* that \"git config --global\" will write to\n$GIT_GLOBAL_CONFIG and \"git config\" without --global will ignore it, but\na test would be welcome.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"200019","messageId":"7vzk4bqtd1.fsf@alter.siamese.dyndns.org","threadId":"31655","inReplyTo":"CAD1m08Wz7WqP8Yxgc6xuhBSntQ0PS6hGOzHWrcd0VAbARmkuUA@mail.gmail.com","subject":"Re: Configuring the location of ~/.gitconfig","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-27T17:16:10Z","receivedAt":"2012-09-27T17:16:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Anurag Priyam <anurag08priyam@gmail.com> writes:\n\n>> Not me. For that particular use case, my approach (long before I\n>> switched the vcs that controls my dotfiles to git) have always been\n>> to have ~/src that is version controlled, with a Makefile that\n>> builds/adjusts dotfiles appropriately for each box and installs them\n>> in the proper place.\n>\n> Makefile is what I wanted to avoid when I suggested Ram that maybe Git\n> could _optionally_ read the location of global gitconfig from an\n> environment variable that can be exported in zshenv or bash_profile.\n\nWhere exactly do the \"zshenv\" and \"bash_profile\" you mention reside,\nand how are their contents kept up to date?  I am guessing it is\n/net/srv1/home/ram/.bash_profile on machines that mount user home\ndirectories from srv1 NFS server and it is to have a string like\n\"export GITCONFIG_FILE=/net/srv1/home/ram/dot/gitconfig\" or on those\nmachines.  The contents of ~ram/dot/gitconfig may be able to stay\nthe same across boxes, but how is ~ram/.bash_profile is set up?\nManually?\n\nAgain, I am not personally interested; I think aversion of Make is\nthe root cause of the disease.\n"},{"id":"200021","messageId":"7vvcezqsug.fsf@alter.siamese.dyndns.org","threadId":"31655","inReplyTo":"1348757171-3223-1-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH] config: introduce GIT_GLOBAL_CONFIG to override ~/.gitconfig","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-27T17:27:19Z","receivedAt":"2012-09-27T17:27:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n> ---\n>  Documentation/git-config.txt |    3 +++\n>  path.c                       |    5 +++++\n>  t/t1306-xdg-files.sh         |    8 ++++++++\n>  3 files changed, 16 insertions(+), 0 deletions(-)\n>\n> diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt\n> index eaea079..c8db03f 100644\n> --- a/Documentation/git-config.txt\n> +++ b/Documentation/git-config.txt\n> @@ -205,6 +205,9 @@ $GIT_DIR/config::\n>  \tUser-specific configuration file. Also called \"global\"\n>  \tconfiguration file.\n>  \n> +$GIT_GLOBAL_CONFIG::\n> +\tOverrides the path of the global configuration file.\n> +\n\nWhy is this even a good idea?\n\n  - Does it make sense not to read $HOME/.gitconfig or XDG stuff\n    when this is set?  Why skip them?  If it makes sense to skip\n    them, why doesn't it also skip $GIT_DIR/config and/or\n    /etc/gitconfig?\n\n  - Why is it not \"the third user-specific configuration file\" instead?\n\n  - Why is it not \"a list of paths to read configurations from\"?\n\n  - Where does it end?\n\nNot overly impressed, I'd have to say.\n\n> diff --git a/path.c b/path.c\n> index cbbdf7d..9b09cee 100644\n> --- a/path.c\n> +++ b/path.c\n> @@ -131,10 +131,15 @@ char *git_path(const char *fmt, ...)\n>  \n>  void home_config_paths(char **global, char **xdg, char *file)\n>  {\n> +\tchar *global_config = getenv(\"GIT_GLOBAL_CONFIG\");\n>  \tchar *xdg_home = getenv(\"XDG_CONFIG_HOME\");\n>  \tchar *home = getenv(\"HOME\");\n>  \tchar *to_free = NULL;\n>  \n> +\tif (global_config) {\n> +\t\t*global = mkpathdup(\"%s\", global_config);\n> +\t\treturn;\n> +\t}\n>  \tif (!home) {\n>  \t\tif (global)\n>  \t\t\t*global = NULL;\n> diff --git a/t/t1306-xdg-files.sh b/t/t1306-xdg-files.sh\n> index 8b14ab1..5b0e08e 100755\n> --- a/t/t1306-xdg-files.sh\n> +++ b/t/t1306-xdg-files.sh\n> @@ -28,6 +28,14 @@ test_expect_success 'read config: xdg file exists and ~/.gitconfig exists' '\n>  \ttest_cmp expected actual\n>  '\n>  \n> +test_expect_success 'read config: $GIT_GLOBAL_CONFIG is set and ~/.gitconfig exists' '\n> +\t>.gitconfig &&\n> +\techo \"[alias]\" >.gittestconfig &&\n> +\techo \"\tmyalias = !echo in_gitconfig\" >>.gittestconfig &&\n> +\techo in_gitconfig >expected &&\n> +\tGIT_GLOBAL_CONFIG=~/.gittestconfig git myalias >actual &&\n\nHow is this tilde expanded and by whom?\n"},{"id":"200023","messageId":"20120927173532.GD1547@sigill.intra.peff.net","threadId":"31655","inReplyTo":"1348757171-3223-1-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH] config: introduce GIT_GLOBAL_CONFIG to override ~/.gitconfig","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-09-27T17:35:32Z","receivedAt":"2012-09-27T17:35:32Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Sep 27, 2012 at 08:16:11PM +0530, Ramkumar Ramachandra wrote:\n\n> diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt\n> index eaea079..c8db03f 100644\n> --- a/Documentation/git-config.txt\n> +++ b/Documentation/git-config.txt\n> @@ -205,6 +205,9 @@ $GIT_DIR/config::\n>  \tUser-specific configuration file. Also called \"global\"\n>  \tconfiguration file.\n>  \n> +$GIT_GLOBAL_CONFIG::\n> +\tOverrides the path of the global configuration file.\n> +\n\nLike the other reviews, I am not overly enthused. If we are going to add\na new variable, I think $GIT_HOME makes a lot more sense. But it really\nsounds like using $XDG_CONFIG_HOME would be even simpler.\n\nAlso, have you considered using a config include? Like:\n\n  $ echo '[include]path = ~/my-dotfiles/gitconfig' >~/.gitconfig\n\nIt's a one-time setup, and then you get updates inside my-dotfiles\nforever. The one-time setup is annoying, but you have to bootstrap\nsomehow (e.g., you're going to have to copy a .profile or similar to get\nthe GIT_GLOBAL_CONFIG variable set).\n\n-Peff\n"},{"id":"200028","messageId":"7vk3vfqrrp.fsf@alter.siamese.dyndns.org","threadId":"31655","inReplyTo":"vpq626zjtds.fsf@grenoble-inp.fr","subject":"Re: [PATCH] config: introduce GIT_GLOBAL_CONFIG to override ~/.gitconfig","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-27T17:50:34Z","receivedAt":"2012-09-27T17:50:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n> Ramkumar Ramachandra <artagnon@gmail.com> writes:\n>\n>> diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt\n>> index eaea079..c8db03f 100644\n>> --- a/Documentation/git-config.txt\n>> +++ b/Documentation/git-config.txt\n>> @@ -205,6 +205,9 @@ $GIT_DIR/config::\n>>  \tUser-specific configuration file. Also called \"global\"\n>>  \tconfiguration file.\n>>  \n>> +$GIT_GLOBAL_CONFIG::\n>> +\tOverrides the path of the global configuration file.\n>> +\n>\n> I'm not particularly in favor of introducing another environment\n> variable, but if you are to introduce it, why just override the\n> configuration file, and not $HOME completely (e.g. to override\n> $HOME/.git-credentials too).\n>\n> There was a patch proposing that here ($GIT_HOME to override $HOME):\n\nI think both of these are at the entrance of slippery slope to\ninsanity I'd rather not to venture into.\n\nIf somebody hates ~/.dotmanyfiles so much, why not do HOME=~/dots/,\ninstead of having to set GIT_HOME to move ~/.gitconfig, FROTZ_HOME\nto move ~/.frotzconfig, MAIL_HOME to move ~/.mailrc, etc.?\n\nI wouldn't be surprised if some _other_ things break with your HOME\npointing at a directory inside your home directory, but then it may\nbe better to fix that other thing instead.\n"},{"id":"200044","messageId":"7vtxujp7c6.fsf@alter.siamese.dyndns.org","threadId":"31655","inReplyTo":"20120927173532.GD1547@sigill.intra.peff.net","subject":"Re: [PATCH] config: introduce GIT_GLOBAL_CONFIG to override ~/.gitconfig","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-27T19:57:13Z","receivedAt":"2012-09-27T19:57:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Also, have you considered using a config include? Like:\n>\n>   $ echo '[include]path = ~/my-dotfiles/gitconfig' >~/.gitconfig\n\nVery good suggestion.\n\n> ... you have to bootstrap\n> somehow (e.g., you're going to have to copy a .profile or similar to get\n> the GIT_GLOBAL_CONFIG variable set).\n\nExactly my thought ;-)\n"},{"id":"200048","messageId":"vpqzk4bfaua.fsf@grenoble-inp.fr","threadId":"31655","inReplyTo":"20120927173532.GD1547@sigill.intra.peff.net","subject":"Re: [PATCH] config: introduce GIT_GLOBAL_CONFIG to override ~/.gitconfig","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2012-09-27T20:51:41Z","receivedAt":"2012-09-27T20:51:41Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Jeff King <peff@peff.net> writes:\n\n> Also, have you considered using a config include? Like:\n>\n>   $ echo '[include]path = ~/my-dotfiles/gitconfig' >~/.gitconfig\n>\n> It's a one-time setup, and then you get updates inside my-dotfiles\n> forever. The one-time setup is annoying, but you have to bootstrap\n> somehow (e.g., you're going to have to copy a .profile or similar to get\n> the GIT_GLOBAL_CONFIG variable set).\n\nI also strongly prefer symlinks or include over environment variables.\nRelying on environment variables makes the setup a bit fragile, partly\nbecause I often mess things up with my shell (e.g. I once had different\nshell and environment variables in ~/.xsession and in actual shells,\nhence different configuration depending on whether I launch stuff from\nmy window-manager or from a shell).\n\nI could understand using environment variables for one-shot\nconfiguration change (e.g. HOME=/tmp/ git whatever), but then $HOME is\nsufficient in general.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"200071","messageId":"CALkWK0=CCLrfM2Jr_JNVP0VQnp1dvRAkDjRrTsogvpD8rGrumw@mail.gmail.com","threadId":"31655","inReplyTo":"20120927173532.GD1547@sigill.intra.peff.net","subject":"Re: [PATCH] config: introduce GIT_GLOBAL_CONFIG to override ~/.gitconfig","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2012-09-28T07:05:31Z","receivedAt":"2012-09-28T07:05:31Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Jeff King wrote:\n> Like the other reviews, I am not overly enthused. If we are going to add\n> a new variable, I think $GIT_HOME makes a lot more sense. But it really\n> sounds like using $XDG_CONFIG_HOME would be even simpler.\n>\n> Also, have you considered using a config include? Like:\n>\n>   $ echo '[include]path = ~/my-dotfiles/gitconfig' >~/.gitconfig\n\nSounds like this is the way to go.  Or I could pick up Junio's\nsuggestion to use a Makefile.  I'll discontinue working on the patch.\n\nThanks.\n\nRam\n"}]}