Re: [PATCH 08/15] scalar: implement the `clone` subcommand
From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-08-31 08:26:32
On Mon, Aug 30 2021, Johannes Schindelin via GitGitGadget wrote:
This implements Scalar's opinionated `clone` command: it tries to use a partial clone and sets up a sparse checkout by default. In contrast to `git clone`, `scalar clone` sets up the worktree in the `src/` subdirectory, to encourage a separation between the source files and the build output (which helps Git tremendously because it avoids untracked files that have to be specifically ignored when refreshing the index).
Perhaps nobody else wondered this while reading this, but I thought this might be some sparse/worktree magic where cloning into "foo" would have "foo/.git", but the worktree was somehow magically mapped at foo/src/". But no, it just takes your "scalar clone <url> foo" and translates it to "foo/src", so you'll get a directory at "foo".
Note: We intentionally use a slightly wasteful `set_config()` function (which does not reuse a single `strbuf`, for example, though performance _really_ does not matter here) for convenience and readability.
FWIW I think the commit message could do without this, that part of the code is obviously not performance sensitive at all. But maybe an explicit note helps anyway...