Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: git/git
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ed1b87ef91
Choose a base ref
...
head repository: git/git
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0c16cd499d
Choose a head ref
  • 10 commits
  • 32 files changed
  • 1 contributor

Commits on Dec 5, 2017

  1. extension.partialclone: introduce partial clone extension

    Introduce new repository extension option:
        `extensions.partialclone`
    
    See the update to Documentation/technical/repository-version.txt
    in this patch for more information.
    
    Signed-off-by: Jonathan Tan <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    jonathantanmy authored and gitster committed Dec 5, 2017
    Configuration menu
    Copy the full SHA
    75b97fe View commit details
    Browse the repository at this point in the history
  2. fsck: introduce partialclone extension

    Currently, Git does not support repos with very large numbers of objects
    or repos that wish to minimize manipulation of certain blobs (for
    example, because they are very large) very well, even if the user
    operates mostly on part of the repo, because Git is designed on the
    assumption that every referenced object is available somewhere in the
    repo storage. In such an arrangement, the full set of objects is usually
    available in remote storage, ready to be lazily downloaded.
    
    Teach fsck about the new state of affairs. In this commit, teach fsck
    that missing promisor objects referenced from the reflog are not an
    error case; in future commits, fsck will be taught about other cases.
    
    Signed-off-by: Jonathan Tan <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    jonathantanmy authored and gitster committed Dec 5, 2017
    Configuration menu
    Copy the full SHA
    498f1f6 View commit details
    Browse the repository at this point in the history
  3. fsck: support refs pointing to promisor objects

    Teach fsck to not treat refs referring to missing promisor objects as an
    error when extensions.partialclone is set.
    
    For the purposes of warning about no default refs, such refs are still
    treated as legitimate refs.
    
    Signed-off-by: Jonathan Tan <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    jonathantanmy authored and gitster committed Dec 5, 2017
    Configuration menu
    Copy the full SHA
    43f2515 View commit details
    Browse the repository at this point in the history
  4. fsck: support referenced promisor objects

    Teach fsck to not treat missing promisor objects indirectly pointed to
    by refs as an error when extensions.partialclone is set.
    
    Signed-off-by: Jonathan Tan <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    jonathantanmy authored and gitster committed Dec 5, 2017
    Configuration menu
    Copy the full SHA
    caba7fc View commit details
    Browse the repository at this point in the history
  5. fsck: support promisor objects as CLI argument

    Teach fsck to not treat missing promisor objects provided on the CLI as
    an error when extensions.partialclone is set.
    
    Signed-off-by: Jonathan Tan <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    jonathantanmy authored and gitster committed Dec 5, 2017
    Configuration menu
    Copy the full SHA
    096c9b8 View commit details
    Browse the repository at this point in the history
  6. index-pack: refactor writing of .keep files

    In a subsequent commit, index-pack will be taught to write ".promisor"
    files which are similar to the ".keep" files it knows how to write.
    Refactor the writing of ".keep" files, so that the implementation of
    writing ".promisor" files becomes easier.
    
    Signed-off-by: Jonathan Tan <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    jonathantanmy authored and gitster committed Dec 5, 2017
    Configuration menu
    Copy the full SHA
    8e29c7c View commit details
    Browse the repository at this point in the history
  7. introduce fetch-object: fetch one promisor object

    Introduce fetch-object, providing the ability to fetch one object from a
    promisor remote.
    
    This uses fetch-pack. To do this, the transport mechanism has been
    updated with 2 flags, "from-promisor" to indicate that the resulting
    pack comes from a promisor remote (and thus should be annotated as such
    by index-pack), and "no-dependents" to indicate that only the objects
    themselves need to be fetched (but fetching additional objects is
    nevertheless safe).
    
    Whenever "no-dependents" is used, fetch-pack will refrain from using any
    object flags, because it is most likely invoked as part of a dynamic
    object fetch by another Git command (which may itself use object flags).
    An alternative to this is to leave fetch-pack alone, and instead update
    the allocation of flags so that fetch-pack's flags never overlap with
    any others, but this will end up shrinking the number of flags available
    to nearly every other Git command (that is, every Git command that
    accesses objects), so the approach in this commit was used instead.
    
    This will be tested in a subsequent commit.
    
    Signed-off-by: Jonathan Tan <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    jonathantanmy authored and gitster committed Dec 5, 2017
    Configuration menu
    Copy the full SHA
    88e2f9e View commit details
    Browse the repository at this point in the history

Commits on Dec 8, 2017

  1. sha1_file: support lazily fetching missing objects

    Teach sha1_file to fetch objects from the remote configured in
    extensions.partialclone whenever an object is requested but missing.
    
    The fetching of objects can be suppressed through a global variable.
    This is used by fsck and index-pack.
    
    However, by default, such fetching is not suppressed. This is meant as a
    temporary measure to ensure that all Git commands work in such a
    situation. Future patches will update some commands to either tolerate
    missing objects (without fetching them) or be more efficient in fetching
    them.
    
    In order to determine the code changes in sha1_file.c necessary, I
    investigated the following:
     (1) functions in sha1_file.c that take in a hash, without the user
         regarding how the object is stored (loose or packed)
     (2) functions in packfile.c (because I need to check callers that know
         about the loose/packed distinction and operate on both differently,
         and ensure that they can handle the concept of objects that are
         neither loose nor packed)
    
    (1) is handled by the modification to sha1_object_info_extended().
    
    For (2), I looked at for_each_packed_object and others.  For
    for_each_packed_object, the callers either already work or are fixed in
    this patch:
     - reachable - only to find recent objects
     - builtin/fsck - already knows about missing objects
     - builtin/cat-file - warning message added in this commit
    
    Callers of the other functions do not need to be changed:
     - parse_pack_index
       - http - indirectly from http_get_info_packs
       - find_pack_entry_one
         - this searches a single pack that is provided as an argument; the
           caller already knows (through other means) that the sought object
           is in a specific pack
     - find_sha1_pack
       - fast-import - appears to be an optimization to not store a file if
         it is already in a pack
       - http-walker - to search through a struct alt_base
       - http-push - to search through remote packs
     - has_sha1_pack
       - builtin/fsck - already knows about promisor objects
       - builtin/count-objects - informational purposes only (check if loose
         object is also packed)
       - builtin/prune-packed - check if object to be pruned is packed (if
         not, don't prune it)
       - revision - used to exclude packed objects if requested by user
       - diff - just for optimization
    
    Signed-off-by: Jonathan Tan <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    jonathantanmy authored and gitster committed Dec 8, 2017
    Configuration menu
    Copy the full SHA
    8b4c010 View commit details
    Browse the repository at this point in the history
  2. rev-list: support termination at promisor objects

    Teach rev-list to support termination of an object traversal at any
    object from a promisor remote (whether one that the local repo also has,
    or one that the local repo knows about because it has another promisor
    object that references it).
    
    This will be used subsequently in gc and in the connectivity check used
    by fetch.
    
    For efficiency, if an object is referenced by a promisor object, and is
    in the local repo only as a non-promisor object, object traversal will
    not stop there. This is to avoid building the list of promisor object
    references.
    
    (In list-objects.c, the case where obj is NULL in process_blob() and
    process_tree() do not need to be changed because those happen only when
    there is a conflict between the expected type and the existing object.
    If the object doesn't exist, an object will be synthesized, which is
    fine.)
    
    Signed-off-by: Jonathan Tan <[email protected]>
    Signed-off-by: Jeff Hostetler <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    jonathantanmy authored and gitster committed Dec 8, 2017
    Configuration menu
    Copy the full SHA
    df11e19 View commit details
    Browse the repository at this point in the history
  3. gc: do not repack promisor packfiles

    Teach gc to stop traversal at promisor objects, and to leave promisor
    packfiles alone. This has the effect of only repacking non-promisor
    packfiles, and preserves the distinction between promisor packfiles and
    non-promisor packfiles.
    
    Signed-off-by: Jonathan Tan <[email protected]>
    Signed-off-by: Jeff Hostetler <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    jonathantanmy authored and gitster committed Dec 8, 2017
    Configuration menu
    Copy the full SHA
    0c16cd4 View commit details
    Browse the repository at this point in the history
Loading