revision.c: discount side branches when computing TREESAME
authorKevin Bracey <kevin@bracey.fi>
Thu, 16 May 2013 15:32:39 +0000 (18:32 +0300)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 May 2013 18:51:10 +0000 (11:51 -0700)
commit4d826608e9610851d29440ca290e54b701921608
treedcae3f11bb893adf66bec4a3bd2cb6a098012a6c
parent7f34a46ff57121910c9ad697c2809a2d01ed1673
revision.c: discount side branches when computing TREESAME

Use the BOTTOM flag to define relevance for pruning. Relevant commits
are those that are !UNINTERESTING or BOTTOM, and this allows us to
identify irrelevant side branches (UNINTERESTING && !BOTTOM).

If a merge has relevant parents, and it is TREESAME to them, then do not
let irrelevant parents cause the merge to be treated as !TREESAME.

When considering simplification, don't always include all merges -
merges with exactly one relevant parent can be simplified, if TREESAME
according to the above rule.

These two changes greatly increase simplification in limited, pruned
revision lists.

Signed-off-by: Kevin Bracey <kevin@bracey.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
revision.c
t/t6019-rev-list-ancestry-path.sh
t/t6111-rev-list-treesame.sh