git-filter-repo/t/t9390/degenerate-keepme
Elijah Newren 5ba62ba4e8 filter-repo: add testcases dealing with topology changes
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>
2019-04-29 09:56:38 -07:00

105 lines
1.8 KiB
Plaintext

feature done
blob
mark :1
data 10
keepme v1
reset refs/heads/branchO
commit refs/heads/branchO
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
keepme v2
commit refs/heads/branchO
mark :4
author Full Name <user@organization.tld> 2000050000 +0100
committer Full Name <user@organization.tld> 2000050000 +0100
data 2
G
from :2
M 100644 :3 moduleA/keepme
commit refs/heads/branchI
mark :5
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 :4
merge :2
commit refs/heads/branchO
mark :6
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 :2
merge :4
blob
mark :7
data 10
keepme v3
commit refs/heads/branchO
mark :8
author Full Name <user@organization.tld> 2000092000 +0100
committer Full Name <user@organization.tld> 2000092000 +0100
data 2
L
from :6
M 100644 :7 moduleA/keepme
blob
mark :9
data 10
keepme v4
commit refs/heads/master
mark :10
author Full Name <user@organization.tld> 3000000000 +0100
committer Full Name <user@organization.tld> 3000000000 +0100
data 2
Q
from :8
M 100644 :9 moduleA/keepme
blob
mark :11
data 10
keepme v5
commit refs/heads/master
mark :12
author Full Name <user@organization.tld> 3000030000 +0100
committer Full Name <user@organization.tld> 3000030000 +0100
data 2
T
from :10
M 100644 :11 moduleA/keepme
blob
mark :13
data 10
keepme v6
commit refs/heads/master
mark :14
author Full Name <user@organization.tld> 3000060000 +0100
committer Full Name <user@organization.tld> 3000060000 +0100
data 2
W
from :12
M 100644 :13 moduleA/keepme
done