{"thread":{"id":"2931","subject":"Re: [PATCH] add strcpy_user_path() and use it in init-db.c and git.c","startedAt":"2005-12-26T17:42:31Z","lastAt":"2005-12-26T17:42:31Z","messageCount":1,"participants":["Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"14044","messageId":"Pine.LNX.4.63.0512261840060.8240@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2931","inReplyTo":null,"subject":"Re: [PATCH] add strcpy_user_path() and use it in init-db.c and git.c","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-12-26T17:42:31Z","receivedAt":"2005-12-26T17:42:31Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"[Sorry, this mail will probably be sent to you twice. The mailserver I \nuse normally is kinda broken. It sends out the mails one or two days late, \nso paradoxically, the resent mail will arrive earlier than the original.]\n\nHi,\n\nOn Sat, 24 Dec 2005, Eric Wong wrote:\n\n> Junio C Hamano <junkio@cox.net> wrote:\n> > Eric Wong <normalperson@yhbt.net> writes:\n> > \n> > > My home directories have different names on different machines I'm\n> > > on, and I want to avoid having to recompile git for each one.\n> > > I don't have root access to some of them, so installing globally in /usr\n> > > or /usr/local isn't an option, either.\n> > \n> > Then you probably need to use GIT_EXEC_PATH environment\n> > variable.\n> \n> That works with git.c but not init-db.  But then again I don't use\n> git-init-db that often.  I'll just write a shell script wrapper for the\n> latter if I do.\n\nHow about something like this?\n\n---\n[PATCH] Introduce environment variable for the path to the templates\n\nThe environment variable GIT_TEMPLATE_PATH can override the compiled-in\nsetting, and can be overridden with the '--template=' argument to init-db.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\n---\n\n\tEric said that GIT_EXEC_PATH is enough for most things, but not for\n\tinit-db. I guess he wanted something like this.\n\n init-db.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\n5d95ce750b09a14bcb86e07ba23077ab0825089c\ndiff --git a/init-db.c b/init-db.c\nindex 863ec1a..774a91f 100644\n--- a/init-db.c\n+++ b/init-db.c\n@@ -238,7 +238,7 @@ int main(int argc, char **argv)\n {\n \tconst char *git_dir;\n \tconst char *sha1_dir;\n-\tchar *path, *template_dir = NULL;\n+\tchar *path, *template_dir = getenv(\"GIT_TEMPLATE_PATH\");\n \tint len, i;\n \n \tfor (i = 1; i < argc; i++, argv++) {\n-- \n1.0.GIT\n"}]}