Re: [PATCH 17/22] entry.c: optionally checkout newly cloned submodules
- From
Johannes Sixt <j.sixt@eudaptics.com>
- Date
- May 24, 2007, 13:28 UTC
- Message-ID
- <46559304.611B83B@eudaptics.com>
- In-Reply-To
- <11799589931860-git-send-email-skimo@liacs.nl>
skimo@liacs.nl 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...
Show 14 quoted lines
> +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