#include "tag.h"
#include "commit-reach.h"
#include "ewah/ewok.h"
+#include "trace2.h"
/* Remember to update object flag allocation in object.h */
#define PARENT1 (1u<<16)
{ compare_commits_by_gen_then_commit_date }
};
int i;
+ int steps = 0;
timestamp_t last_gen = GENERATION_NUMBER_INFINITY;
struct commit_list **tail = result;
struct commit_list *parents;
int flags;
timestamp_t generation = commit_graph_generation(commit);
+ steps++;
if (min_generation && generation > last_gen)
BUG("bad generation skip %"PRItime" > %"PRItime" at %s",
}
clear_nonstale_queue(&queue);
+ trace2_data_intmax("paint_down_to_common", r,
+ "steps", steps);
commit_list_sort_by_date(result);
return 0;
}
test_all_modes get_merge_bases_many
'
+test_expect_success 'merge-base --all commit-walk steps' '
+ test_when_finished rm -rf .git/objects/info/commit-graph \
+ .git/objects/info/commit-graphs &&
+ rm -rf .git/objects/info/commit-graph \
+ .git/objects/info/commit-graphs &&
+
+ GIT_TRACE2_EVENT="$(pwd)/trace-none.txt" \
+ git merge-base --all commit-9-9 commit-9-1 >actual &&
+ test_trace2_data paint_down_to_common steps 81 <trace-none.txt &&
+
+ cp commit-graph-full .git/objects/info/commit-graph &&
+ GIT_TRACE2_EVENT="$(pwd)/trace-full.txt" \
+ git merge-base --all commit-9-9 commit-9-1 >actual &&
+ test_trace2_data paint_down_to_common steps 80 <trace-full.txt &&
+
+ cp commit-graph-half .git/objects/info/commit-graph &&
+ GIT_TRACE2_EVENT="$(pwd)/trace-half.txt" \
+ git merge-base --all commit-9-9 commit-9-1 >actual &&
+ test_trace2_data paint_down_to_common steps 81 <trace-half.txt
+'
+
test_expect_success 'reduce_heads' '
cat >input <<-\EOF &&
X:commit-1-10