Upstreaming the Scalar command#1005
Closed
dscho wants to merge 15 commits into
Closed
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tl;dr: This series contributes the core part of the Scalar command to the Git project. This command provides a convenient way to clone/initialize very large repositories (think: monorepos).
Note: This patch series' focus is entirely on Scalar, on choosing sensible defaults and offering a delightful user experience around working with monorepos, and not about changing any existing paradigms for
contrib/(even if catching up on the mail thread is likely to give interested readers that false impression).Changes since v9:
Changes since v8:
merge.renamestotrue. This is now the case.ab/ci-updateswhich invalidates assumptions made by this patch series that would still hold true with v2.34.0 but are no longer valid inseenand would trigger CI build breakages.Changes since v7:
contrib/scalar/.README.md.Changes since v6:
contrib/scalar/README.md, containing the roadmap of what I have planned for Scalar.GIT_TEST_MAINT_SCHEDULERhas been adjusted to accommodate for a change in v2.32.0..v2.34.0.fetch.showForcedUpdates=false, which has been identified as helping with a performance issue in large repositories.-c <key>=<value>and-C <directory>was moved to its own add-on patch series: While it is obvious that those options are valuable to have, an open question is whether there are other "pre-command" options ingitthat would be useful, too, and I would like to postpone that discussion to that date.Changes since v5:
make -C contrib/scalar/Makefile.git ls-treeinvocation suggested in the manual forscalar clone.make -C contrib/scalar, then changing a source file oflibgit.aand then immediately invokingmake -C contrib/scalaragain will now implicitly rebuildlibgit.a.Changes since v4:
scalar deletenow refuses to delete anything if it was started from within the enlistment.scalar deletereleases any handles to the object store before deleting the enlistment.OBJECTSlist in theMakefilewill now include Scalar.scalar registernow supports secondary worktrees, in addition to the primary worktree.Changes since v3:
[RFC]prefix because I did not hear any objections against putting this intocontrib/.Changes since v2:
listcommand in the manual page , as suggested by Bagas.cmd_run().git reconfigure -awas improved.Changes since v1:
ls-remotewas made more readablescalar.txtnow consistently uses tabscore.bare = falsewhen registering with ScalarBackground
Microsoft invested a lot of effort into scaling Git to the needs of the Windows operating system source code. Based on the experience of the first approach, VFS for Git, the Scalar project was started. Scalar specifically has as its core goal to funnel all improvements into core Git.
The present
The Scalar project provides a completely functional non-virtual experience for monorepos. But why stop there. The Scalar project was designed to be a self-destructing vehicle to allow those key concepts to be moved into core Git itself for the benefit of all. For example, partial clone, sparse-checkout, and scheduled background maintenance have already been upstreamed and removed from Scalar proper. This patch series provides a C-based implementation of the final remaining portions of the Scalar command. This will make it easier for users to experiment with the Scalar command. It will also make it substantially easier to experiment with moving functionality from Scalar into core Git, while maintaining backwards-compatibility for existing Scalar users.
The C-based Scalar has been shipped to Scalar users, and can be tested by any interested reader: https://github.com/microsoft/git/releases/ (it offers a Git for Windows installer, a macOS package and an Ubuntu package, Scalar has been included since v2.33.0.vfs.0.0).
Next steps
Since there are existing Scalar users, I want to ensure backwards-compatibility with its existing command-line interface. Keeping that in mind, everything in this series is up for discussion.
I obviously believe that Scalar brings a huge benefit, and think that it would be ideal for all of Scalar's learnings to end up in
git clone/git init/git maintenanceeventually. It is also conceivable, however, that thescalarcommand could graduate to be a core part of Git at some stage in the future (such a decision would probably depend highly on users' feedback). See also the discussion about the architecture of Scalar, kicked off by Stolee.On top of this patch series, I have lined up a few more:
scalar diagnosecommand.scalaras part of a regular Git install (also teachinggit help scalarto find the Scalar documentationThese are included in my
vfs-with-scalarbranch thicket. On top of that, this branch thicket also includes patches I do not plan on upstreaming, mainly because they are too specific either to VFS for Git, or they support Azure Repos (which does not offer partial clones but speaks the GVFS protocol, which can be used to emulate partial clones).One other thing is very interesting about that
vfs-with-scalarbranch thicket: it contains a GitHub workflow which will run Scalar's quite extensive Functional Tests suite. This test suite is quite comprehensive and caught us a lot of bugs in the past, not only in the Scalar code, but also core Git.Epilogue
Now, to address some questions that I imagine every reader has who made it this far:
cc: Derrick Stolee stolee@gmail.com
cc: Eric Sunshine sunshine@sunshineco.com
cc: Ævar Arnfjörð Bjarmason avarab@gmail.com
cc: Elijah Newren newren@gmail.com
cc: Bagas Sanjaya bagasdotme@gmail.com
cc: "Theodore Ts'o" tytso@mit.edu
cc: Matt Rogers mattr94@gmail.com
cc: Jeff King peff@peff.net