KEMBAR78
Comparing 1eb0a12ec3...39b44ba771 · git/git · GitHub
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: 1eb0a12ec3
Choose a base ref
...
head repository: git/git
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 39b44ba771
Choose a head ref
  • 2 commits
  • 10 files changed
  • 1 contributor

Commits on Jul 1, 2019

  1. object-store.h: move for_each_alternate_ref() from transport.h

    There's nothing inherently transport-related about enumerating the
    alternate ref tips. The code has lived in transport.[ch] because the
    only use so far had been advertising available tips during transport.
    But it could be used for more, and a future patch will teach rev-list to
    access these refs.
    
    Let's move it alongside the other alt-odb code, declaring it in
    object-store.h with the implementation in sha1-file.c.
    
    This lets us drop the inclusion of transport.h from receive-pack, which
    perhaps shows how it was misplaced (though receive-pack is about
    transporting objects, transport.h is mostly about the client side).
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    peff authored and gitster committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    709dfa6 View commit details
    Browse the repository at this point in the history
  2. check_everything_connected: assume alternate ref tips are valid

    When we receive a remote ref update to sha1 "X", we want to check that
    we have all of the objects needed by "X". We can assume that our
    repository is not currently corrupted, and therefore if we have a ref
    pointing at "Y", we have all of its objects. So we can stop our
    traversal from "X" as soon as we hit "Y".
    
    If we make the same non-corruption assumption about any repositories we
    use to store alternates, then we can also use their ref tips to shorten
    the traversal.
    
    This is especially useful when cloning with "--reference", as we
    otherwise do not have any local refs to check against, and have to
    traverse the whole history, even though the other side may have sent us
    few or no objects. Here are results for the included perf test (which
    shows off more or less the maximal savings, getting one new commit and
    sharing the whole history):
    
    Test                        HEAD^             HEAD
    --------------------------------------------------------------------
    [on git.git]
    5600.3: clone --reference   2.94(2.86+0.08)   0.09(0.08+0.01) -96.9%
    [on linux.git]
    5600.3: clone --reference   45.74(45.34+0.41)   0.36(0.30+0.08) -99.2%
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    peff authored and gitster committed Jul 1, 2019
    Configuration menu
    Copy the full SHA
    39b44ba View commit details
    Browse the repository at this point in the history
Loading