summaryrefslogtreecommitdiff
path: root/t/t5318-commit-graph.sh
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2018-04-10 12:56:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-11 01:43:02 (GMT)
commit3d5df01b5e42416a59e857135e932bbdd8cc3ba0 (patch)
tree39368eb806a613e4d98876c5d5d3b2b4eef5683e /t/t5318-commit-graph.sh
parent049d51a2bb9a03d2f2c2cce1ae41e57dbbf42244 (diff)
downloadgit-3d5df01b5e42416a59e857135e932bbdd8cc3ba0.zip
git-3d5df01b5e42416a59e857135e932bbdd8cc3ba0.tar.gz
git-3d5df01b5e42416a59e857135e932bbdd8cc3ba0.tar.bz2
commit-graph: build graph from starting commits
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: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5318-commit-graph.sh')
-rwxr-xr-xt/t5318-commit-graph.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh
index 3bb44d0..c28cfb5 100755
--- a/t/t5318-commit-graph.sh
+++ b/t/t5318-commit-graph.sh
@@ -177,6 +177,19 @@ test_expect_success 'build graph from latest pack with closure' '
graph_git_behavior 'graph from pack, commit 8 vs merge 1' full commits/8 merge/1
graph_git_behavior 'graph from pack, commit 8 vs merge 2' full commits/8 merge/2
+test_expect_success 'build graph from commits with closure' '
+ cd "$TRASH_DIRECTORY/full" &&
+ git tag -a -m "merge" tag/merge merge/2 &&
+ git rev-parse tag/merge >commits-in &&
+ git rev-parse merge/1 >>commits-in &&
+ cat commits-in | git commit-graph write --stdin-commits &&
+ test_path_is_file $objdir/info/commit-graph &&
+ graph_read_expect "6"
+'
+
+graph_git_behavior 'graph from commits, commit 8 vs merge 1' full commits/8 merge/1
+graph_git_behavior 'graph from commits, commit 8 vs merge 2' full commits/8 merge/2
+
test_expect_success 'setup bare repo' '
cd "$TRASH_DIRECTORY" &&
git clone --bare --no-local full bare &&