Subject: Re: [PATCH 17/22] entry.c: optionally checkout newly cloned submodules

From: Johannes Sixt <[email-masked]>
Date: Thu, 24 May 2007 15:28:36 +0200

[email-masked] wrote:
> +static const char *relativize_path(const char *path, const char *dest)
> +{
> ...
> +}

I really get a head ache when I try to understand the purpose of this
function. A comment or two telling what it's trying to do would really
be helpful. But...

> +int attach_submodule(const char *submodule)
> +{
> +       struct stat st;
> +       const char *submodule_dir, *dest;
> +
> +       submodule_dir = git_path("submodules/%s/.git", submodule);
> +       if (lstat(submodule_dir, &st))
> +               return error("submodule '%s' unavailable", submodule);
> +
> +       dest = mkpath("%s/.git", submodule);
> +       submodule_dir = relativize_path(submodule_dir, dest);
> +
> +       return symlink(submodule_dir, dest);
> +}

I don't like this. Symlinks are a major nuisance on Windows (MinGW
port). Can't we just have this repo itself at this place instead of the
symlink?

-- Hannes