Re: git clone stable-2.6.25.y fails over HTTP

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

Re: git clone stable-2.6.25.y fails over HTTP

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:41

Daniel Barkalow [off-list ref] writes:
On Wed, 4 Jun 2008, Greg KH wrote:
...
quoted
I can duplicate what I did, and it did it again:
	on master.kernel.org:
	$ cd /pub/scm/linux/kernel/git/stable/
	$ git clone -s --bare ../torvalds/linux-2.6.git/ test
	$ cat test/objects/info/alternates
	/home/ftp/pub/scm/linux/kernel/git/torvalds/linux-2.6.git/objects

I'm guessing this is because /pub/ is a symlink:
	$ ls -l /pub
	lrwxrwxrwx 1 root root 13 Feb  4  2006 /pub -> /home/ftp/pub
We're using getcwd() to make the absolute path, but it looks like we 
should check whether $PWD is set and names the same directory, and, if so, 
base on that instead.

Actually, make_absolute_path() seems to go to an awful lot of trouble to 
make sure that there aren't symlinks in the resulting path. Is this 
actually necessary or even desireable for some reason? Should clone be 
just pasting $PWD (or, failing that, getcwd()) and the given path, and 
using that to identify the repo to clone?
I am not 100% sympathetic if ../torvalds/linux-2.6.git/ was what caused
this.  Perhaps 30% or so ;-).

However, I think /pub/scm/linux/kernel/git/torvalds/linux-2.6.git/ would
result in the same breakage, and that is something I consider gravely
broken.

If both are fixed by rethinking the make_absolute_path(), that would be
good.

Re: git clone stable-2.6.25.y fails over HTTP

From: Greg KH <hidden>
Date: 2016-06-15 22:44:42

On Thu, Jun 05, 2008 at 02:26:11PM -0700, Junio C Hamano wrote:
Daniel Barkalow [off-list ref] writes:
quoted
On Wed, 4 Jun 2008, Greg KH wrote:
...
quoted
I can duplicate what I did, and it did it again:
	on master.kernel.org:
	$ cd /pub/scm/linux/kernel/git/stable/
	$ git clone -s --bare ../torvalds/linux-2.6.git/ test
	$ cat test/objects/info/alternates
	/home/ftp/pub/scm/linux/kernel/git/torvalds/linux-2.6.git/objects

I'm guessing this is because /pub/ is a symlink:
	$ ls -l /pub
	lrwxrwxrwx 1 root root 13 Feb  4  2006 /pub -> /home/ftp/pub
We're using getcwd() to make the absolute path, but it looks like we 
should check whether $PWD is set and names the same directory, and, if so, 
base on that instead.

Actually, make_absolute_path() seems to go to an awful lot of trouble to 
make sure that there aren't symlinks in the resulting path. Is this 
actually necessary or even desireable for some reason? Should clone be 
just pasting $PWD (or, failing that, getcwd()) and the given path, and 
using that to identify the repo to clone?
I am not 100% sympathetic if ../torvalds/linux-2.6.git/ was what caused
this.  Perhaps 30% or so ;-).
I agree, if I did something stupid like this, that's my fault.  I didn't
realize that it was stupid, so I guess a simple warning, "don't use
relative paths when cloning with alternates" would have told me so.
However, I think /pub/scm/linux/kernel/git/torvalds/linux-2.6.git/ would
result in the same breakage, and that is something I consider gravely
broken.
Yeah, especially as I never realized that /pub/ was a symlink in the
first place :)

thanks,

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help