Subject: Re: [PATCH 1/2] git-clone: Keep remote names when cloning unless explicitly told not to.

From: Andreas Ericsson <[email-masked]>
Date: Thu, 10 Nov 2005 18:49:12 +0100

Junio C Hamano wrote:
> [email-masked] (Andreas Ericsson) writes:
> 
>>+# Try using "humanish" part of source repo if user didn't specify one
>>+[ -z "$dir" ] && dir=$(echo "$repo" | sed -e 's#/*\.git$##' -e 's#.*[/:]##')
> 
> 
> Micronit; if I version control contents of my home directory on
> host.xz [*1*] under git, I would say host.xz:.git/ when cloning
> it, wouldn't I?
> 

Gah. Does anyone do that?

Anyways,
	sed -e 's#:*/*\.git$##' -e 's#.*[/:]##'
would turn that into "host.xz", so that should work real nice like, I 
suppose.

> Maybe we would want to check if the resulting $dir makes sense
> after this step.
> 

Perhaps, but this would lead to mkdir complaining about the empty 
directory name, so it's no worse than the current code. The sane user 
then looks at the help output and determines that he needs to specify a 
target directory.

-- 
Andreas Ericsson                   [email-masked]
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231