# git clone -l

4 messages from 2008-03-05 to 2008-03-05. Participants: Daniel Barkalow, Junio C Hamano, Brandon Casey.
Thread: https://gitlist.dev/t/12508

## Daniel Barkalow, 2008-03-05 00:03

Subject: git clone -l
Message-ID: <alpine.LNX.1.00.0803041900080.19665@iabervon.org>
URL: https://gitlist.dev/e/alpine.LNX.1.00.0803041900080.19665%40iabervon.org

```
What, exactly, is -l supposed to do for clone? As far as I can tell, we 
automatically do the local magic if we can. Would it be okay to make 
"local" default to "if possible", have "-l" mean error if not possible, 
and have "--no-local" able to avoid using local magic even if we could use 
it?

	-Daniel
*This .sig left intentionally blank*

```

## Junio C Hamano, 2008-03-05 00:32

Subject: Re: git clone -l
Message-ID: <7vd4qa3t9t.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vd4qa3t9t.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <alpine.LNX.1.00.0803041900080.19665@iabervon.org>

```
Daniel Barkalow <barkalow@iabervon.org> writes:

> What, exactly, is -l supposed to do for clone? As far as I can tell, we 
> automatically do the local magic if we can. Would it be okay to make 
> "local" default to "if possible", have "-l" mean error if not possible, 
> and have "--no-local" able to avoid using local magic even if we could use 
> it?

It used to be that "-l" meant "When it is local, use hardlink if possible
otherwise copy without complaining, as either are cheaper than the pack
piped to unpack."  Lack of -l meant no local magic.

Recently lack of -l stopped to mean "no local magic".  We still do the
local magic, but we do not do hardlinks and instead do copies.  An "-l"
that asks clone across filesystems still falls back to copying but now
gets a warning.  "--no-hardlinks" does not have any significance anymore,
as that is what you would get for a local clone without -l.

The way to refuse local magic is to use file://$path/ explicitly; we do
not have --no-local.

```

## Daniel Barkalow, 2008-03-05 00:45

Subject: Re: git clone -l
Message-ID: <alpine.LNX.1.00.0803041937110.19665@iabervon.org>
URL: https://gitlist.dev/e/alpine.LNX.1.00.0803041937110.19665%40iabervon.org
In-Reply-To: <7vd4qa3t9t.fsf@gitster.siamese.dyndns.org>

```
On Tue, 4 Mar 2008, Junio C Hamano wrote:

> Daniel Barkalow <barkalow@iabervon.org> writes:
> 
> > What, exactly, is -l supposed to do for clone? As far as I can tell, we 
> > automatically do the local magic if we can. Would it be okay to make 
> > "local" default to "if possible", have "-l" mean error if not possible, 
> > and have "--no-local" able to avoid using local magic even if we could use 
> > it?
> 
> It used to be that "-l" meant "When it is local, use hardlink if possible
> otherwise copy without complaining, as either are cheaper than the pack
> piped to unpack."  Lack of -l meant no local magic.
> 
> Recently lack of -l stopped to mean "no local magic".  We still do the
> local magic, but we do not do hardlinks and instead do copies.  An "-l"
> that asks clone across filesystems still falls back to copying but now
> gets a warning.  "--no-hardlinks" does not have any significance anymore,
> as that is what you would get for a local clone without -l.
> 
> The way to refuse local magic is to use file://$path/ explicitly; we do
> not have --no-local.

Ah, okay. I was having a hard time getting the not-using-local-magic case 
to be clearly not using local magic, but I think that was confusion on my 
part. Also, it looks like we need a test that not using -l is equivalent 
to --no-hardlinks.

Would it be okay to additionally block local magic, even with a local 
path, if "--no-local" is used? Using our parse-options code means 
--no-local is accepted anyway, and it's a bit confusing that it doesn't 
block default local magic. (Obviously, this won't break anything, since 
old code wouldn't have accepted it.)

	-Daniel
*This .sig left intentionally blank*

```

## Brandon Casey, 2008-03-05 00:53

Subject: Re: git clone -l
Message-ID: <47CDEF11.8000807@nrlssc.navy.mil>
URL: https://gitlist.dev/e/47CDEF11.8000807%40nrlssc.navy.mil
In-Reply-To: <7vd4qa3t9t.fsf@gitster.siamese.dyndns.org>

```
Junio C Hamano wrote:
> Daniel Barkalow <barkalow@iabervon.org> writes:
> 
>> What, exactly, is -l supposed to do for clone? As far as I can tell, we 
>> automatically do the local magic if we can. Would it be okay to make 
>> "local" default to "if possible", have "-l" mean error if not possible, 
>> and have "--no-local" able to avoid using local magic even if we could use 
>> it?
> 
> It used to be that "-l" meant "When it is local, use hardlink if possible
> otherwise copy without complaining, as either are cheaper than the pack
> piped to unpack."  Lack of -l meant no local magic.
> 
> Recently lack of -l stopped to mean "no local magic".  We still do the
> local magic, but we do not do hardlinks and instead do copies.  An "-l"
> that asks clone across filesystems still falls back to copying but now
> gets a warning.  "--no-hardlinks" does not have any significance anymore,
> as that is what you would get for a local clone without -l.

Are you sure?
I thought this was changed by 3d5c418f so that hardlinking is done by default.

  Lack of -l means "do local magic and use hard links".
  Using -l makes git-clone print a warning when hard linking fails.
  --no-hardlinks disables hard linking and still does local magic.

-brandon


```
