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

[PATCH 0/2] Allow cloning to an existing empty directory

From
APAlexander Potashev <aspotashev@gmail.com>
Date
Jan 8, 2009, 23:24 UTC
Message-ID
<1231457063-29186-1-git-send-email-aspotashev@gmail.com>

The problem I experienced today was that I couldn't clone a repo to a separate filesystem. I've created a new LVM volume, a FS on it (XFS) and mounted it to a directory.

But wasn't able to clone the repo to that directory. It's impossible to mount a FS to a non-existent directory, right? But Git refuses to clone to an existing directory.

The solution in my first patch allows cloning to an existing empty directory. However, there could be problems doing the same as I did with XFS using ext2-like filesystems, because they have lost+found directories, i.e. the root directory of those FSs is never empty.

The first patch adds a function (is_pseudo_dir_name) to compare a string with "." and "..", the second patch reuses that function in the rest of the code.

Alexander Potashev (2):
  Allow cloning to an existing empty directory
  Use is_pseudo_dir_name everywhere
 builtin-clone.c         |    8 +++++---
 builtin-count-objects.c |    5 ++---
 builtin-fsck.c          |   14 ++++----------
 builtin-prune.c         |   14 ++++----------
 builtin-rerere.c        |   11 +++++------
 dir.c                   |   31 +++++++++++++++++++++++--------
 dir.h                   |    8 ++++++++
 entry.c                 |    5 ++---
 remote.c                |    6 ++----
 transport.c             |    4 +---
 10 files changed, 56 insertions(+), 50 deletions(-)
Next: Alexander Potashev
Message 1 of 8 in “Allow cloning to an existing empty directory”
  1. 0/2 Allow cloning to an existing empty directoryAlexander Potashev, Jan 8, 2009
  2. 1/2 Allow cloning to an existing empty directoryAlexander Potashev, Jan 8, 2009
  3. 2/2 Use is_pseudo_dir_name everywhereAlexander Potashev, Jan 8, 2009
  4. Johannes SixtJan 9, 2009
  5. Johannes SixtJan 9, 2009
  6. Junio C HamanoJan 9, 2009
  7. Alexander PotashevJan 9, 2009
  8. Junio C HamanoJan 10, 2009

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.