1. 11 4月, 2018 11 次提交
    • D
      treewide: replace maybe_tree with accessor methods · 2e27bd77
      Derrick Stolee 提交于
      In anticipation of making trees load lazily, create a Coccinelle
      script (contrib/coccinelle/commit.cocci) to ensure that all
      references to the 'maybe_tree' member of struct commit are either
      mutations or accesses through get_commit_tree() or
      get_commit_tree_oid().
      
      Apply the Coccinelle script to create the rest of the patch.
      Signed-off-by: NDerrick Stolee <dstolee@microsoft.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2e27bd77
    • D
      commit: create get_commit_tree() method · 5bb03de1
      Derrick Stolee 提交于
      While walking the commit graph, we load struct commit objects into
      the object cache. During this process, we also load struct tree
      objects for the root tree of each of these commits. We load these
      objects even if we are only computing commit reachability information,
      such as a merge base or ahead/behind information.
      
      Create get_commit_tree() as a first step to removing direct
      references to the 'maybe_tree' member of struct commit.
      
      Create get_commit_tree_oid() as a shortcut for several references
      to "&commit->maybe_tree->object.oid" in the codebase.
      Signed-off-by: NDerrick Stolee <dstolee@microsoft.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5bb03de1
    • D
      treewide: rename tree to maybe_tree · 891435d5
      Derrick Stolee 提交于
      Using the commit-graph file to walk commit history removes the large
      cost of parsing commits during the walk. This exposes a performance
      issue: lookup_tree() takes a large portion of the computation time,
      even when Git never uses those trees.
      
      In anticipation of lazy-loading these trees, rename the 'tree' member
      of struct commit to 'maybe_tree'. This serves two purposes: it hints
      at the future role of possibly being NULL even if the commit has a
      valid tree, and it allows for unambiguous transformation from simple
      member access (i.e. commit->maybe_tree) to method access.
      Signed-off-by: NDerrick Stolee <dstolee@microsoft.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      891435d5
    • J
      Merge branch 'bw/c-plus-plus' into ds/lazy-load-trees · 2d5792f0
      Junio C Hamano 提交于
      * bw/c-plus-plus: (37 commits)
        replace: rename 'new' variables
        trailer: rename 'template' variables
        tempfile: rename 'template' variables
        wrapper: rename 'template' variables
        environment: rename 'namespace' variables
        diff: rename 'template' variables
        environment: rename 'template' variables
        init-db: rename 'template' variables
        unpack-trees: rename 'new' variables
        trailer: rename 'new' variables
        submodule: rename 'new' variables
        split-index: rename 'new' variables
        remote: rename 'new' variables
        ref-filter: rename 'new' variables
        read-cache: rename 'new' variables
        line-log: rename 'new' variables
        imap-send: rename 'new' variables
        http: rename 'new' variables
        entry: rename 'new' variables
        diffcore-delta: rename 'new' variables
        ...
      2d5792f0
    • D
      commit-graph: implement "--append" option · 7547b95b
      Derrick Stolee 提交于
      Teach git-commit-graph to add all commits from the existing
      commit-graph file to the file about to be written. This should be
      used when adding new commits without performing garbage collection.
      Signed-off-by: NDerrick Stolee <dstolee@microsoft.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7547b95b
    • D
      commit-graph: build graph from starting commits · 3d5df01b
      Derrick Stolee 提交于
      Teach git-commit-graph to read commits from stdin when the
      --stdin-commits flag is specified. Commits reachable from these
      commits are added to the graph. This is a much faster way to construct
      the graph than inspecting all packed objects, but is restricted to
      known tips.
      
      For the Linux repository, 700,000+ commits were added to the graph
      file starting from 'master' in 7-9 seconds, depending on the number
      of packfiles in the repo (1, 24, or 120).
      Signed-off-by: NDerrick Stolee <dstolee@microsoft.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3d5df01b
    • D
      commit-graph: read only from specific pack-indexes · 049d51a2
      Derrick Stolee 提交于
      Teach git-commit-graph to inspect the objects only in a certain list
      of pack-indexes within the given pack directory. This allows updating
      the commit graph iteratively.
      Signed-off-by: NDerrick Stolee <dstolee@microsoft.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      049d51a2
    • D
      commit: integrate commit graph with commit parsing · 177722b3
      Derrick Stolee 提交于
      Teach Git to inspect a commit graph file to supply the contents of a
      struct commit when calling parse_commit_gently(). This implementation
      satisfies all post-conditions on the struct commit, including loading
      parents, the root tree, and the commit date.
      
      If core.commitGraph is false, then do not check graph files.
      
      In test script t5318-commit-graph.sh, add output-matching conditions on
      read-only graph operations.
      
      By loading commits from the graph instead of parsing commit buffers, we
      save a lot of time on long commit walks. Here are some performance
      results for a copy of the Linux repository where 'master' has 678,653
      reachable commits and is behind 'origin/master' by 59,929 commits.
      
      | Command                          | Before | After  | Rel % |
      |----------------------------------|--------|--------|-------|
      | log --oneline --topo-order -1000 |  8.31s |  0.94s | -88%  |
      | branch -vv                       |  1.02s |  0.14s | -86%  |
      | rev-list --all                   |  5.89s |  1.07s | -81%  |
      | rev-list --all --objects         | 66.15s | 58.45s | -11%  |
      Signed-off-by: NDerrick Stolee <dstolee@microsoft.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      177722b3
    • D
      commit-graph: close under reachability · 4f2542b4
      Derrick Stolee 提交于
      Teach write_commit_graph() to walk all parents from the commits
      discovered in packfiles. This prevents gaps given by loose objects or
      previously-missed packfiles.
      
      Also automatically add commits from the existing graph file, if it
      exists.
      Signed-off-by: NDerrick Stolee <dstolee@microsoft.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4f2542b4
    • D
      commit-graph: add core.commitGraph setting · 1b70dfd5
      Derrick Stolee 提交于
      The commit graph feature is controlled by the new core.commitGraph config
      setting. This defaults to 0, so the feature is opt-in.
      
      The intention of core.commitGraph is that a user can always stop checking
      for or parsing commit graph files if core.commitGraph=0.
      Signed-off-by: NDerrick Stolee <dstolee@microsoft.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1b70dfd5
    • D
      commit-graph: implement git commit-graph read · 2a2e32bd
      Derrick Stolee 提交于
      Teach git-commit-graph to read commit graph files and summarize their contents.
      
      Use the read subcommand to verify the contents of a commit graph file in the
      tests.
      Signed-off-by: NDerrick Stolee <dstolee@microsoft.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2a2e32bd
  2. 03 4月, 2018 7 次提交
  3. 14 3月, 2018 2 次提交
  4. 23 2月, 2018 20 次提交