Thread (4 messages) flat view 4 messages, 3 authors, 2016-06-15

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

From: Matthias Lederhofer <hidden>
Date: 2016-06-15 22:42:27

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.
Here, $template is either empty string "", or "--template=dir"
after argument parsing.  But then it does this:
quoted
@@ -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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help