diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2018-07-20 16:33:27 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-07-20 22:38:56 (GMT) |
commit | 1e3497a24cf13fe907b247d1b93a997d6537cca1 (patch) | |
tree | e869604b1e84ebee748645776caa40c57ab8bccd /commit-reach.h | |
parent | 1fee1242577ae23b32c33ff1122402bb228f2692 (diff) | |
download | git-1e3497a24cf13fe907b247d1b93a997d6537cca1.zip git-1e3497a24cf13fe907b247d1b93a997d6537cca1.tar.gz git-1e3497a24cf13fe907b247d1b93a997d6537cca1.tar.bz2 |
commit-reach: replace ref_newer logic
The ref_newer method is used by 'git push' to check if a force-push is
required. This method does not use any kind of cutoff when walking, so
in the case of a force-push will walk all reachable commits.
The is_descendant_of method already uses paint_down_to_common along with
cutoffs. By translating the ref_newer arguments into the commit and
commit_list required by is_descendant_of, we can have one fewer commit
walk and also improve our performance!
For a copy of the Linux repository, 'test-tool reach ref_newer' presents
the following improvements with the specified input. In the case that
ref_newer returns 1, there is no improvement. The improvement is in the
second case where ref_newer returns 0.
Input:
A:v4.9
B:v3.19
Before: 0.09 s
After: 0.09 s
To test the negative case, add a new commit with parent v3.19,
regenerate the commit-graph, and then run with B pointing at that
commit.
Before: 0.43 s
After: 0.09 s
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-reach.h')
0 files changed, 0 insertions, 0 deletions