git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] add strcpy_user_path() and use it in init-db.c and git.c

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Dec 26, 2005, 17:42 UTC
Message-ID
<Pine.LNX.4.63.0512261840060.8240@wbgn013.biozentrum.uni-wuerzburg.de>

[Sorry, this mail will probably be sent to you twice. The mailserver I use normally is kinda broken. It sends out the mails one or two days late, so paradoxically, the resent mail will arrive earlier than the original.]

Hi,
On Sat, 24 Dec 2005, Eric Wong wrote:
Show 14 quoted lines
> Junio C Hamano <junkio@cox.net> wrote:
> > Eric Wong <normalperson@yhbt.net> writes:
> > 
> > > My home directories have different names on different machines I'm
> > > on, and I want to avoid having to recompile git for each one.
> > > I don't have root access to some of them, so installing globally in /usr
> > > or /usr/local isn't an option, either.
> > 
> > Then you probably need to use GIT_EXEC_PATH environment
> > variable.
> 
> That works with git.c but not init-db.  But then again I don't use
> git-init-db that often.  I'll just write a shell script wrapper for the
> latter if I do.
How about something like this?

--- [PATCH] Introduce environment variable for the path to the templates

The environment variable GIT_TEMPLATE_PATH can override the compiled-in setting, and can be overridden with the '--template=' argument to init-db.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
	Eric said that GIT_EXEC_PATH is enough for most things, but not for
	init-db. I guess he wanted something like this.
 init-db.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
5d95ce750b09a14bcb86e07ba23077ab0825089c
diff --git a/init-db.c b/init-db.c
index 863ec1a..774a91f 100644
--- a/init-db.c
+++ b/init-db.c
@@ -238,7 +238,7 @@ int main(int argc, char **argv)
 {
 	const char *git_dir;
 	const char *sha1_dir;
-	char *path, *template_dir = NULL;
+	char *path, *template_dir = getenv("GIT_TEMPLATE_PATH");
 	int len, i;
 
 	for (i = 1; i < argc; i++, argv++) {
-- 
1.0.GIT
Message 1 of 1 in “Re: [PATCH] add strcpy_user_path() and use it in init-db.c and git.c”
  1. Johannes SchindelinDec 26, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.