]> git.ipfire.org Git - thirdparty/git.git/commit - revision.c
simplify-merges: drop merge from irrelevant side branch
authorKevin Bracey <kevin@bracey.fi>
Thu, 16 May 2013 15:32:37 +0000 (18:32 +0300)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 May 2013 18:51:09 +0000 (11:51 -0700)
commit143f1eafdb0d326b1a8e3d15bf59a497b9440bf1
tree4d0bcbc1d3556b68a055cfd76dabfbbd51d33517
parent9c129eab99f16d7bb174b35573e68ae6a5d02efe
simplify-merges: drop merge from irrelevant side branch

Reimplement commit 4b7f53da on top of the new simplify-merges
infrastructure, tightening the condition to only consider root parents;
the original version incorrectly dropped parents that were TREESAME to
anything.

Original log message follows.

The merge simplification rule stated in 6546b59 (revision traversal:
show full history with merge simplification, 2008-07-31) still
treated merge commits too specially.  Namely, in a history with this
shape:

---o---o---M
          /
         x---x---x

where three 'x' were on a history completely unrelated to the main
history 'o' and do not touch any of the paths we are following, we
still said that after simplifying all of the parents of M, 'x'
(which is the leftmost 'x' that rightmost 'x simplifies down to) and
'o' (which would be the last commit on the main history that touches
the paths we are following) are independent from each other, and
both need to be kept.

That is incorrect; when the side branch 'x' never touches the paths,
it should be removed to allow M to simplify down to the last commit
on the main history that touches the paths.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Kevin Bracey <kevin@bracey.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/rev-list-options.txt
revision.c
t/t6012-rev-list-simplify.sh