Re: [PATCH] Use the template mechanism to set up refs/ hierarchy as well.

4 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] Use the template mechanism to set up refs/ hierarchy as well.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:03

Johannes Schindelin [off-list ref] writes:
quoted
This may be controversial from the robustness standpoint, so I
am placing it in the proposed update queue first.  Discussions
on the list very welcomed.
I'd vote against it: As of now, I can perfectly do

export PATH=$PATH:/whereever/my/git/is
git-init-db

which would not work with this patch.
I take it to mean that you do not mind building but would want
to try it out before installing.

Yes, that is similar to what I meant by "robustness".  Maybe we
could do two things to make it palatable:

 * Instead of $src/templates/Makefile installing in place, give
   it a real 'build' target that creates $src/templates/blt/
   hierarchy and build things there (I expect we would need some
   templates that needs installation specific customization
   later, and really want to avoid making $src/templates
   something that is copied straight out).  "make install" would
   copy it out to the final destination.

 * Make git-init-db create an absolute minimum $GIT_DIR
   structure itself, if the template directory is not available,
   possibly with a warning.

Then, your post-build pre-installation trial can go like this:

    $ make
    $ PATH=`pwd`:"$PATH"
    $ GIT_TEMPLATE_DIRECTORY=`pwd`/templates/blt
    $ export PATH GIT_TEMPLATE_DIRECTORY
    $ cd /where/ever
    $ git-init-db

Re: [PATCH] Use the template mechanism to set up refs/ hierarchy as well.

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:42:03

Hi,

On Thu, 4 Aug 2005, Junio C Hamano wrote:
Johannes Schindelin [off-list ref] writes:
quoted
quoted
This may be controversial from the robustness standpoint, so I
am placing it in the proposed update queue first.  Discussions
on the list very welcomed.
I'd vote against it: As of now, I can perfectly do

export PATH=$PATH:/whereever/my/git/is
git-init-db

which would not work with this patch.
I take it to mean that you do not mind building but would want
to try it out before installing.
I'd like to not being forced to install git. Scenario: I have an SSH 
account on a remote machine. I am not root there, but I'd like to 
synchronize my work with git. I can not install git.
* Make git-init-db create an absolute minimum $GIT_DIR
  structure itself, if the template directory is not available,
  possibly with a warning.
This would be exactly what I'd like. Let git-init-db create 
.git/objects/[0-9a-f]{2}/, .git/refs/heads/, .git/refs/tags and .git/HEAD. 
Everything else is taken from the templates directory, if that exists. I 
would not warn if it does not.

Ciao,
Dscho

Re: [PATCH] Use the template mechanism to set up refs/ hierarchy as well.

From: <hidden>
Date: 2016-06-15 22:42:03

On Thu, 4 Aug 2005, Johannes Schindelin wrote:
quoted
* Make git-init-db create an absolute minimum $GIT_DIR
structure itself, if the template directory is not available,
possibly with a warning.
This would be exactly what I'd like. Let git-init-db create
.git/objects/[0-9a-f]{2}/, .git/refs/heads/, .git/refs/tags and .git/HEAD.
Everything else is taken from the templates directory, if that exists. I would
not warn if it does not.
Are .git/refs/heads and .git/refs/tags still needed? I seem to recall a 
patch to create subdirectories of .git/refs on demand (needed for 
tags/v99/1). I'd say just .git/objects/(everything), .git/refs, and 
.git/info.

(Plus template, if available, of course)

	-Daniel
*This .sig left intentionally blank*

Re: [PATCH] Use the template mechanism to set up refs/ hierarchy as well.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:03

barkalow@iabervon.org writes:
... I seem to recall a patch to create subdirectories of
.git/refs on demand (needed for tags/v99/1). I'd say just
.git/objects/(everything), .git/refs, and .git/info.
Having thought about this a bit more, I am inclined to drop
this.  I see the template mechanism to be something that lets
site and project policy makers set up the repositories to suit
their taste, by having their users point their own template
directory via the GIT_TEMPLATE_DIRECTORY environment variable.
How $GIT_DIR/refs/heads/ and $GIT_DIR/refs/tags/ are used are
quite deeply ingrained in the core tools, and there is no point
pretending as if they can be overridden; they are not.

As Daniel says, refs/*/ are created mostly on-demand [*1*], so
it is not strictly necessary to create "heads" and "tags"
upfront, but they are so basic that I'd feel comfortable to keep
them part of what are done by git-init-db.


[Footnote]

*1* I fixed one in receive-pack recently, but please fix things
if you find any of the core tools assume that the leading paths
already exist.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help