Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sparse-checkout: list directories in cone mode #500

Closed

Commits on Dec 30, 2019

  1. sparse-checkout: list directories in cone mode

    When core.sparseCheckoutCone is enabled, the 'git sparse-checkout set'
    command takes a list of directories as input, then creates an ordered
    list of sparse-checkout patterns such that those directories are
    recursively included and all sibling entries along the parent directories
    are also included. Listing the patterns is less user-friendly than the
    directories themselves.
    
    In cone mode, and as long as the patterns match the expected cone-mode
    pattern types, change the output of 'git sparse-checkout list' to only
    show the directories that created the patterns.
    
    With this change, the following piped commands would not change the
    working directory:
    
    	git sparse-checkout list | git sparse-checkout set --stdin
    
    The only time this would not work is if core.sparseCheckoutCone is
    true, but the sparse-checkout file contains patterns that do not
    match the expected pattern types for cone mode.
    
    Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
    derrickstolee committed Dec 30, 2019
    Configuration menu
    Copy the full SHA
    7d4295b View commit details
    Browse the repository at this point in the history
  2. sparse-checkout: document interactions with submodules

    Using 'git submodule (init|deinit)' a user can select a subset of
    submodules to populate. This behaves very similar to the sparse-checkout
    feature, but those directories contain their own .git directory
    including an object database and ref space. To have the sparse-checkout
    file also determine if those files should exist would easily cause
    problems. Therefore, keeping these features independent in this way
    is the best way forward.
    
    Also create a test that demonstrates this behavior to make sure
    it doesn't change as the sparse-checkout feature evolves.
    
    Reported-by: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
    derrickstolee committed Dec 30, 2019
    Configuration menu
    Copy the full SHA
    74bbd0f View commit details
    Browse the repository at this point in the history