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

[PATCH Cogito] Strip .git suffix from destination directory

From
MHMarcel Holtmann <marcel@holtmann.org>
Date
May 9, 2005, 01:10 UTC
Message-ID
<1115601034.8949.99.camel@pegasus>
Hi Petr,

the attached patch brings back the feature where a .git suffix got stripped from the directory name when cloning another tree.

It also fixes a $samedir vs. $same_dir spelling mistake.
Regards
Marcel
cg-clone: needs update
Index: cg-clone
===================================================================
--- 00b94eea5b99d5dd1d1bbe9c9ca3502d11aec581/cg-clone  (mode:100755)
+++ uncommitted/cg-clone  (mode:100755)
@@ -28,10 +28,10 @@
 
 destdir=$2
 if [ "$destdir" ]; then
-	[ ! "$samedir" ] || die "specifying both -s and DESTDIR makes no sense"
+	[ ! "$same_dir" ] || die "specifying both -s and DESTDIR makes no sense"
 	dir=$destdir
 else
-	dir=${location%/.git}; dir=${dir##*/}
+	dir=${location%/.git}; dir=${dir##*/}; dir=${dir%.git}
 fi
 
 if ! echo "$location" | grep -q ":" ; then
Message 1 of 1 in “Strip .git suffix from destination directory”
  1. Strip .git suffix from destination directoryMarcel Holtmann, May 9, 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.