Re: [PATCH 08/15] scalar: implement the `clone` subcommand
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Aug 31, 2021, 08:23 UTC
- Message-ID
- <87a6kyxbo1.fsf@evledraar.gmail.com>
- In-Reply-To
- <2cbf0b611133df5fa7eed1bf38460f9d119d2a6e.1630359290.git.gitgitgadget@gmail.com>
On Mon, Aug 30 2021, Johannes Schindelin via GitGitGadget wrote:
Show 6 quoted lines
> 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...