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

Re: [PATCH] new environment variable GIT_TEMPLATE_DIR to override default template

From
MLMatthias Lederhofer <matled@gmx.net>
Date
May 28, 2006, 18:15 UTC
Message-ID
<E1FkPnB-0005yW-UY@moooo.ath.cx>
In-Reply-To
<7v4pzadpfr.fsf@assigned-by-dhcp.cox.net>
> I like the part to let git-clone pass --template down to git-init-db,
> but once it is in place I doubt you would still need GIT_TEMPLATE_DIR.
> I'd rather not to introduce new environment variables if we can
> avoid them.

I like the variable because it makes it very easy to change the default template directory (so I don't have to remember passing --template every time I clone or create a new repository). But aliases/default options (~/.git/config thread) this would make this possible too.

Show 12 quoted lines
> Here, $template is either empty string "", or "--template=dir"
> after argument parsing.  But then it does this:
> 
> > @@ -203,7 +206,7 @@ trap 'err=$?; cd ..; rm -r "$D"; exit $e
> >  case "$bare" in
> >  yes) GIT_DIR="$D" ;;
> >  *) GIT_DIR="$D/.git" ;;
> > -esac && export GIT_DIR && git-init-db || usage
> > +esac && export GIT_DIR && git-init-db "$template" || usage
> 
> which I suspect would make git-init-db barf if you did not pass
> any --template=foo option to git-clone.  Did you test your patch?

Sorry, I did not run make test and did not test it without the option. Shall I send a new patch?

Previous: Junio C Hamano
Message 4 of 4 in “Re: [PATCH 2/2] make init-db use GIT_TEMPLATE_DIR if --template option is not specified”
  1. Petr BaudisMay 27, 2006
  2. new environment variable GIT_TEMPLATE_DIR to override default templateMatthias Lederhofer, May 27, 2006
  3. Junio C HamanoMay 28, 2006
  4. Matthias LederhoferMay 28, 2006

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.