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>
268 lines
4.7 KiB
Plaintext
268 lines
4.7 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 10
|
|
nukeme v1
|
|
|
|
commit refs/heads/master
|
|
mark :4
|
|
author Full Name <user@organization.tld> 2000010000 +0100
|
|
committer Full Name <user@organization.tld> 2000010000 +0100
|
|
data 2
|
|
B
|
|
from :2
|
|
M 100644 :3 moduleB/nukeme
|
|
|
|
blob
|
|
mark :5
|
|
data 10
|
|
nukeme v2
|
|
|
|
commit refs/heads/master
|
|
mark :6
|
|
author Full Name <user@organization.tld> 2000020000 +0100
|
|
committer Full Name <user@organization.tld> 2000020000 +0100
|
|
data 2
|
|
C
|
|
from :2
|
|
M 100644 :5 moduleB/nukeme
|
|
|
|
commit refs/heads/master
|
|
mark :7
|
|
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 :4
|
|
merge :6
|
|
|
|
blob
|
|
mark :8
|
|
data 10
|
|
nukeme v3
|
|
|
|
commit refs/heads/master
|
|
mark :9
|
|
author Full Name <user@organization.tld> 2000040000 +0100
|
|
committer Full Name <user@organization.tld> 2000040000 +0100
|
|
data 2
|
|
F
|
|
from :7
|
|
M 100644 :8 moduleB/nukeme
|
|
|
|
blob
|
|
mark :10
|
|
data 10
|
|
keepme v2
|
|
|
|
commit refs/heads/master
|
|
mark :11
|
|
author Full Name <user@organization.tld> 2000050000 +0100
|
|
committer Full Name <user@organization.tld> 2000050000 +0100
|
|
data 2
|
|
G
|
|
from :9
|
|
M 100644 :10 moduleA/keepme
|
|
|
|
blob
|
|
mark :12
|
|
data 10
|
|
nukem4 v4
|
|
|
|
commit refs/heads/master
|
|
mark :13
|
|
author Full Name <user@organization.tld> 2000060000 +0100
|
|
committer Full Name <user@organization.tld> 2000060000 +0100
|
|
data 2
|
|
H
|
|
from :11
|
|
M 100644 :12 moduleB/nukeme
|
|
|
|
commit refs/heads/branchI
|
|
mark :14
|
|
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 :13
|
|
merge :7
|
|
|
|
commit refs/heads/master
|
|
mark :15
|
|
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 :7
|
|
merge :13
|
|
|
|
blob
|
|
mark :16
|
|
data 10
|
|
nukeme v4
|
|
|
|
commit refs/heads/master
|
|
mark :17
|
|
author Full Name <user@organization.tld> 2000090000 +0100
|
|
committer Full Name <user@organization.tld> 2000090000 +0100
|
|
data 2
|
|
K
|
|
from :15
|
|
M 100644 :16 moduleB/nukeme
|
|
|
|
blob
|
|
mark :18
|
|
data 10
|
|
keepme v3
|
|
|
|
commit refs/heads/master
|
|
mark :19
|
|
author Full Name <user@organization.tld> 2000092000 +0100
|
|
committer Full Name <user@organization.tld> 2000092000 +0100
|
|
data 2
|
|
L
|
|
from :17
|
|
M 100644 :18 moduleA/keepme
|
|
|
|
blob
|
|
mark :20
|
|
data 10
|
|
nukeme v5
|
|
|
|
commit refs/heads/master
|
|
mark :21
|
|
author Full Name <user@organization.tld> 2000094000 +0100
|
|
committer Full Name <user@organization.tld> 2000094000 +0100
|
|
data 2
|
|
M
|
|
from :19
|
|
M 100644 :20 moduleB/nukeme
|
|
|
|
blob
|
|
mark :22
|
|
data 10
|
|
nukeme v6
|
|
|
|
commit refs/heads/master
|
|
mark :23
|
|
author Full Name <user@organization.tld> 2000096000 +0100
|
|
committer Full Name <user@organization.tld> 2000096000 +0100
|
|
data 2
|
|
N
|
|
from :6
|
|
M 100644 :22 moduleB/nukeme
|
|
|
|
commit refs/heads/branchO
|
|
mark :24
|
|
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 :21
|
|
merge :23
|
|
|
|
commit refs/heads/master
|
|
mark :25
|
|
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 :23
|
|
merge :21
|
|
|
|
blob
|
|
mark :26
|
|
data 10
|
|
keepme v4
|
|
|
|
commit refs/heads/master
|
|
mark :27
|
|
author Full Name <user@organization.tld> 3000000000 +0100
|
|
committer Full Name <user@organization.tld> 3000000000 +0100
|
|
data 2
|
|
Q
|
|
from :25
|
|
M 100644 :26 moduleA/keepme
|
|
|
|
blob
|
|
mark :28
|
|
data 10
|
|
nukeme v7
|
|
|
|
commit refs/heads/master
|
|
mark :29
|
|
author Full Name <user@organization.tld> 3000010000 +0100
|
|
committer Full Name <user@organization.tld> 3000010000 +0100
|
|
data 2
|
|
R
|
|
from :27
|
|
M 100644 :28 moduleB/nukeme
|
|
|
|
commit refs/heads/master
|
|
mark :30
|
|
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 :29
|
|
merge :29
|
|
|
|
blob
|
|
mark :31
|
|
data 10
|
|
keepme v5
|
|
|
|
commit refs/heads/master
|
|
mark :32
|
|
author Full Name <user@organization.tld> 3000030000 +0100
|
|
committer Full Name <user@organization.tld> 3000030000 +0100
|
|
data 2
|
|
T
|
|
from :30
|
|
M 100644 :31 moduleA/keepme
|
|
|
|
blob
|
|
mark :33
|
|
data 10
|
|
nukeme v8
|
|
|
|
commit refs/heads/master
|
|
mark :34
|
|
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 :32
|
|
merge :32
|
|
M 100644 :33 moduleB/nukeme
|
|
|
|
blob
|
|
mark :35
|
|
data 10
|
|
keepme v6
|
|
|
|
commit refs/heads/master
|
|
mark :36
|
|
author Full Name <user@organization.tld> 3000060000 +0100
|
|
committer Full Name <user@organization.tld> 3000060000 +0100
|
|
data 2
|
|
W
|
|
from :34
|
|
M 100644 :35 moduleA/keepme
|
|
|
|
done
|