mirror of
https://github.com/newren/git-filter-repo.git
synced 2024-09-01 00:00:06 +02:00
Pruning of commits which become empty can result in a variety of topology changes: a merge may have lost all its ancestors corresponding to one of (or more) of its parents, a merge may end up merging a commit with itself, or a merge may end up merging a commit with its own ancestor. Merging a commit with itself makes no sense, so we'd rather prune down to one parent and hopefully prune the merge commit, but we do need to worry about whether the are changes in the commit and whether the original merge commit also merged something with itself. We have similar cases for dealing with a merge of some commit with its own ancestor: if the original topology did the same, or the merge commit has additional file changes, then we cannot remove the commit. But, otherwise, the commit can be pruned. Add testcases covering the variety of changes that can occur to make sure we get them right. Signed-off-by: Elijah Newren <newren@gmail.com>
195 lines
3.4 KiB
Plaintext
195 lines
3.4 KiB
Plaintext
feature done
|
|
blob
|
|
mark :1
|
|
data 10
|
|
keepme v1
|
|
|
|
reset refs/heads/master
|
|
commit refs/heads/master
|
|
mark :2
|
|
author Full Name <user@organization.tld> 2000000000 +0100
|
|
committer Full Name <user@organization.tld> 2000000000 +0100
|
|
data 2
|
|
A
|
|
M 100644 :1 moduleA/keepme
|
|
|
|
blob
|
|
mark :3
|
|
data 13
|
|
sometimes v1
|
|
|
|
commit refs/heads/master
|
|
mark :4
|
|
author Full Name <user@organization.tld> 2000030000 +0100
|
|
committer Full Name <user@organization.tld> 2000030000 +0100
|
|
data 29
|
|
D: Merge commit 'C' into 'B'
|
|
from :2
|
|
merge :2
|
|
M 100644 :3 moduleA/sometimes
|
|
|
|
blob
|
|
mark :5
|
|
data 10
|
|
keepme v2
|
|
|
|
commit refs/heads/master
|
|
mark :6
|
|
author Full Name <user@organization.tld> 2000050000 +0100
|
|
committer Full Name <user@organization.tld> 2000050000 +0100
|
|
data 2
|
|
G
|
|
from :4
|
|
M 100644 :5 moduleA/keepme
|
|
|
|
blob
|
|
mark :7
|
|
data 13
|
|
sometimes v2
|
|
|
|
commit refs/heads/branchI
|
|
mark :8
|
|
author Full Name <user@organization.tld> 2000070000 +0100
|
|
committer Full Name <user@organization.tld> 2000070000 +0100
|
|
data 29
|
|
I: Merge commit 'D' into 'H'
|
|
from :6
|
|
merge :4
|
|
M 100644 :7 moduleA/sometimes
|
|
|
|
blob
|
|
mark :9
|
|
data 13
|
|
sometimes v3
|
|
|
|
commit refs/heads/master
|
|
mark :10
|
|
author Full Name <user@organization.tld> 2000080000 +0100
|
|
committer Full Name <user@organization.tld> 2000080000 +0100
|
|
data 29
|
|
J: Merge commit 'H' into 'D'
|
|
from :4
|
|
merge :6
|
|
M 100644 :9 moduleA/sometimes
|
|
|
|
blob
|
|
mark :11
|
|
data 10
|
|
keepme v3
|
|
|
|
commit refs/heads/master
|
|
mark :12
|
|
author Full Name <user@organization.tld> 2000092000 +0100
|
|
committer Full Name <user@organization.tld> 2000092000 +0100
|
|
data 2
|
|
L
|
|
from :10
|
|
M 100644 :11 moduleA/keepme
|
|
|
|
commit refs/heads/branchO
|
|
mark :13
|
|
author Full Name <user@organization.tld> 2000098000 +0100
|
|
committer Full Name <user@organization.tld> 2000098000 +0100
|
|
data 29
|
|
O: Merge commit 'N' into 'M'
|
|
from :12
|
|
merge :2
|
|
D moduleA/sometimes
|
|
|
|
blob
|
|
mark :14
|
|
data 13
|
|
sometimes v5
|
|
|
|
commit refs/heads/master
|
|
mark :15
|
|
author Full Name <user@organization.tld> 2000099000 +0100
|
|
committer Full Name <user@organization.tld> 2000099000 +0100
|
|
data 29
|
|
P: Merge commit 'M' into 'N'
|
|
from :2
|
|
merge :12
|
|
M 100644 :14 moduleA/sometimes
|
|
|
|
blob
|
|
mark :16
|
|
data 10
|
|
keepme v4
|
|
|
|
commit refs/heads/master
|
|
mark :17
|
|
author Full Name <user@organization.tld> 3000000000 +0100
|
|
committer Full Name <user@organization.tld> 3000000000 +0100
|
|
data 2
|
|
Q
|
|
from :15
|
|
M 100644 :16 moduleA/keepme
|
|
|
|
blob
|
|
mark :18
|
|
data 13
|
|
sometimes v6
|
|
|
|
commit refs/heads/master
|
|
mark :19
|
|
author Full Name <user@organization.tld> 3000020000 +0100
|
|
committer Full Name <user@organization.tld> 3000020000 +0100
|
|
data 29
|
|
S: Merge commit 'R' into 'R'
|
|
from :17
|
|
merge :17
|
|
M 100644 :18 moduleA/sometimes
|
|
|
|
blob
|
|
mark :20
|
|
data 10
|
|
keepme v5
|
|
|
|
commit refs/heads/master
|
|
mark :21
|
|
author Full Name <user@organization.tld> 3000030000 +0100
|
|
committer Full Name <user@organization.tld> 3000030000 +0100
|
|
data 2
|
|
T
|
|
from :19
|
|
M 100644 :20 moduleA/keepme
|
|
|
|
blob
|
|
mark :22
|
|
data 13
|
|
sometimes v7
|
|
|
|
commit refs/heads/master
|
|
mark :23
|
|
author Full Name <user@organization.tld> 3000040000 +0100
|
|
committer Full Name <user@organization.tld> 3000040000 +0100
|
|
data 2
|
|
U
|
|
from :21
|
|
M 100644 :22 moduleA/sometimes
|
|
|
|
commit refs/heads/master
|
|
mark :24
|
|
author Full Name <user@organization.tld> 3000050000 +0100
|
|
committer Full Name <user@organization.tld> 3000050000 +0100
|
|
data 29
|
|
V: Merge commit 'U' into 'U'
|
|
from :23
|
|
merge :23
|
|
|
|
blob
|
|
mark :25
|
|
data 10
|
|
keepme v6
|
|
|
|
commit refs/heads/master
|
|
mark :26
|
|
author Full Name <user@organization.tld> 3000060000 +0100
|
|
committer Full Name <user@organization.tld> 3000060000 +0100
|
|
data 2
|
|
W
|
|
from :24
|
|
M 100644 :25 moduleA/keepme
|
|
|
|
done
|