option to not update submodules when doing checkout

Open
#1,494 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp, git
Domain
tooling

Research direction

Start at Commands.Checkout and the CheckoutOptions and CheckoutModifiers types shown in the issue, then trace where submodule updates are triggered. Verify the checkout behavior and identify how an option could suppress that update; done means a checkout can skip submodule updates while preserving the existing behavior by default, with coverage for the new option.

Written by the indexing model from the issue text.

Description

it seems to be a known issue that, at least when there are numerous binary files in a submodule, the submodule update process takes much longer than specifically checking out each submodule. I am, using libgit2sharp to do these checkouts, but the checkout on the superproject takes much longer (~5 sec for super vs <0.1sec for each submodule).
It looks like Commands.Checkout is, effectively, running:

git checkout [sha]
git submodule update --recursive -f

or something like it, but I just want the first line, not both. Is there some repositoryOption or CheckoutOption or something I can use to use it like this?

my usage of ligit2sharp is:

using (Repository repo =  new Repository(filePath))
{
   //logging and timing
   Commands.Checkout(
      repo,
      commit,
      new CheckoutOptions() { CheckoutModifiers = CheckoutModifiers.Force }
      );
   //logging and timing
}
Dominant language
C#
Stars
3.5k
Forks
925
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from libgit2/libgit2sharp

All issues in libgit2/libgit2sharp

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.