Prepare for vanilla Git repos#272
Merged
derrickstolee merged 12 commits intomicrosoft:masterfrom Jan 2, 2020
derrickstolee:pre-vanilla
Merged
Prepare for vanilla Git repos#272derrickstolee merged 12 commits intomicrosoft:masterfrom derrickstolee:pre-vanilla
derrickstolee merged 12 commits intomicrosoft:masterfrom
derrickstolee:pre-vanilla
Conversation
Signed-off-by: Derrick Stolee <stolee@gmail.com>
When we run functional tests inside the Scalar source code, we need our vanilla Git repos to be recognized inside that repo. The old logic would look for "src/.git" first, finding the Scalar repo before looking just for ".git". This makes the code simpler, too! Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
jrbriggs
approved these changes
Jan 2, 2020
Scalar.FunctionalTests/Tests/EnlistmentPerFixture/PackfileMaintenanceStepTests.cs
Outdated
Show resolved
Hide resolved
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
derrickstolee
added a commit
that referenced
this pull request
Jan 8, 2020
Replaces #258. Resolves #254. If you have a "vanilla" Git repo, then run `scalar repos add` in that repo. Scalar will detect the repo root, register that root with the service, and the maintenance steps will run. The way we identify a vanilla Git repo (now) is if the object cache dir is not given by config and hence we do all operations on the local `.git` folder. This will not work with Git worktrees, but we will also not discover a `.git` _folder_ (worktrees use a `.git` _file_) so the enlistment will be invalid. * The `commit-graph` task will generate the incremental commit-graph files using the `--reachable` option. This will be a no-op if the user has not changed their refs. * The `packfile` task will write a `multi-pack-index` and do the expire/repack logic. To actually do something, the batch-size is decreased if the total pack size is smaller than 2gb. (This was done in #272.) * The `loose-objects` task will delete loose objects already in pack-files and put them into a new `from-loose` pack. This required no change. * The `fetch-commits-and-trees` task is renamed the `fetch` task. On a vanilla Git repo, it will simply call `git fetch <remote> --no-update-remote-refs +refs/head/*:refs/hidden/<remote>/*` for each `<remote>` given by `git remote`. This downloads a pack-file with the new objects not reachable form the current refs, but also does not update `refs/remotes/`. The user will see their refs update as normal, but the pack download is much smaller. * The `config` task (added by #272) runs the necessary Git config. This step is run in `scalar repos add`, but also in the background with the service. All config options become optional for vanilla Git repos, so a user can opt-out of the settings we recommend.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
These commits are cherry-picked from #258 with slight modifications. The functionality here makes sense for repos cloned by Scalar, allowing us to focus later on the interactions with vanilla Git repos.
ConfigStepfor running the Git config commands at clone time and as the service starts up. This already has some split for vanilla Git repos, but that code does not get exercised. Resolves Create a config maintenance step #252.PackfileMaintenanceStepattempts to repack all but the largest pack when those packs sum to less than 2gb.scalar repos (add|list)allows tracking the registered repos. Resolves some of Add a verb for manually registering/unregistering repos #214.