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

Two last-minute changes before 2.46.0 #678

Merged
merged 3 commits into from
Jul 16, 2024

Commits on Jul 16, 2024

  1. Revert "midx-write.c: use --stdin-packs when repacking"

    This reverts commit b7d6f23.
    
    This commit caused a regression in the incremental-repack maintenance
    step where not all objects in a pack-file are repacked, thus 'git
    multi-pack-index expire' cannot delete the pack-files. This will require
    some careful explanation upstream and some careful untangling of how
    server-side repacks may be depending on the new logic. Since
    microsoft/git only serves client users, it is safe to revert this in
    isolation for now.
    
    Signed-off-by: Derrick Stolee <[email protected]>
    derrickstolee committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    8177b6f View commit details
    Browse the repository at this point in the history
  2. advice: warn when sparse index expands

    Typically, forcing a sparse index to expand to a full index means that
    Git could not determine the status of a file outside of the
    sparse-checkout and needed to expand sparse trees into the full list of
    sparse blobs. This operation can be very slow when the sparse-checkout
    is much smaller than the full tree at HEAD.
    
    When users are in this state, there is usually a modified or untracked
    file outside of the sparse-checkout mentioned by the output of 'git
    status'. There are a number of reasons why this is insufficient:
    
     1. Users may not have a full understanding of which files are inside or
        outside of their sparse-checkout. This is more common in monorepos
        that manage the sparse-checkout using custom tools that map build
        dependencies into sparse-checkout definitions.
    
     2. In some cases, an empty directory could exist outside the
        sparse-checkout and these empty directories are not reported by 'git
        status' and friends.
    
     3. If the user has '.gitignore' or 'exclude' files, then 'git status'
        will squelch the warnings and not demonstrate any problems.
    
    In order to help users who are in this state, add a new advice message
    to indicate that a sparse index is expanded to a full index. This
    message should be written at most once per process, so add a static
    global 'give_advice_on_expansion' to sparse-index.c. Further, there is a
    case in 'git sparse-checkout set' that uses the sparse index as an
    in-memory data structure (even when writing a full index) so we need to
    disable the message in that kind of case.
    
    The t1092-sparse-checkout-compatibility.sh test script compares the
    behavior of several Git commands across full and sparse repositories,
    including sparse repositories with and without a sparse index. We need
    to disable the advice in the sparse-index repo to avoid differences in
    stderr. By leaving the advice on in the sparse-checkout repo (without
    the sparse index), we can test the behavior of disabling the advice in
    convert_to_sparse(). (Indeed, these tests are how that necessity was
    discovered.) Add a test that reenables the advice and demonstrates that
    the message is output.
    
    The advice message is defined outside of expand_index() to avoid super-
    wide lines. It is also defined as a macro to avoid compile issues with
    -Werror=format-security.
    
    Signed-off-by: Derrick Stolee <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    derrickstolee committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    46eed1b View commit details
    Browse the repository at this point in the history
  3. t: remove advice from some tests

    These seem to be custom tests to microsoft/git as they break without
    these changes, but these changes are not needed upstream.
    
    Signed-off-by: Derrick Stolee <[email protected]>
    derrickstolee committed Jul 16, 2024
    Configuration menu
    Copy the full SHA
    7976fdc View commit details
    Browse the repository at this point in the history