git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Andreas Ericsson <ae@op5.se>
Date
Nov 10, 2005, 17:49 UTC
Message-ID
<43738818.4010906@op5.se>
In-Reply-To
<7vd5l81l15.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
Show 10 quoted lines
> exon@op5.se (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                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Previous: Junio C Hamano
Message 3 of 3 in “git-clone: Keep remote names when cloning unless explicitly told not to.”
  1. 1/2 git-clone: Keep remote names when cloning unless explicitly told not to.Andreas Ericsson, Nov 10, 2005
  2. Junio C HamanoNov 10, 2005
  3. Andreas EricssonNov 10, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.