Jonathan Nieder <> writes:

> Nguyễn Thái Ngọc Duy wrote:
>> --separate-git-dir was added to clone with the repository away from
>> standard position <worktree>/.git. It does not make sense to use it
>> without creating working directory.
>> Signed-off-by: Nguyễn Thái Ngọc Duy <>
> The patch correctly implements the above.  The description leaves out
> detail.  I'd say something like
>       The --separate-git-dir option was introduced to make it simple
>       to put the git directory somewhere outside the worktree, for
>       example when cloning a repository for use as a submodule.
>       It was not intended for use when creating a bare repository.
>       In that case there is no worktree and it is more natural to
>       directly clone the repository and create a .git file as
>       separate steps:
>               git clone --bare /path/to/repo.git bar.git
>               printf 'gitdir: bar.git\n' >foo.git
>       Unfortunately we forgot to forbid the --bare
>       --separate-git-dir combination.  In practice, we know no one
>       could be using --bare with --separate-git-dir because it is
>       broken in the following way: <explanation here>.  So it is
>       safe to make good on our mistake and forbid the combination,
>       making the command easier to explain.
> I don't know what would go in the <explanation here> blank above,
> though.  Is it possible that some people are relying on this option
> combination?

I do not necessarily think we must say "it happens not to work
already for such and such reasons, lucky us!", but it is indeed a
good idea to think things through, justifying why this cannot be a
regression, and record the fact that we did that thinking, in the
log message.

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to