Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved multiline string handling #333

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions assets/issues/issue-225/expected-dyff-spruce.human
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

data
± value change in multiline text (one insert)
string foo = "bar";
string x_forwarded_host = 53;
string worker_status = 54;
uint64 worker_cpu_time_micro = 55;

± value change in multiline text (one insert, no deletions)
 string foo = "bar";
 + string x_forwarded_host = 53;
 + string worker_status = 54;
 + uint64 worker_cpu_time_micro = 55;


49 changes: 24 additions & 25 deletions assets/kubernetes/configmaps/expected-dyff-spruce.human
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@

data.pinniped.yaml
± value change in multiline text (one insert, one deletion)
discovery:
 url: null
api:
 servingCertificate:
 durationSeconds: 2592000
 renewBeforeSeconds: 12160000
apiGroupSuffix: pinniped.dev
# aggregatedAPIServerPort may be set here, although other YAML references to the default port (10250) may also need to be updated
# impersonationProxyServerPort may be set here, although other YAML references to the default port (8444) may also need to be updated
names:
 servingCertificateSecret: pinniped-concierge-api-tls-serving-certificate
 credentialIssuer: pinniped-concierge-config
 apiService: pinniped-concierge-api
 impersonationLoadBalancerService: pinniped-concierge-impersonation-proxy-load-balancer
 impersonationClusterIPService: pinniped-concierge-impersonation-proxy-cluster-ip
 impersonationTLSCertificateSecret: pinniped-concierge-impersonation-proxy-tls-serving-certificate
 impersonationCACertificateSecret: pinniped-concierge-impersonation-proxy-ca-certificate
 impersonationSignerSecret: pinniped-concierge-impersonation-proxy-signer-ca-certificate
 agentServiceAccount: pinniped-concierge-kube-cert-agent
labels: {"app": "pinniped-concierge"}
kubeCertAgent:
 namePrefix: pinniped-concierge-kube-cert-agent-
 image: projects.registry.vmware.com/pinniped/pinniped-server:latest

± value change in multiline text (one insert, two deletions)
 discovery:
 url: null
 api:
 servingCertificate:
 durationSeconds: 2592000
 - renewBeforeSeconds: 2160000
 + renewBeforeSeconds: 12160000
 apiGroupSuffix: pinniped.dev
 # aggregatedAPIServerPort may be set here, although other YAML references to the default port (10250) may also need to be updated
 # impersonationProxyServerPort may be set here, although other YAML references to the default port (8444) may also need to be updated
 names:
 
 [five lines unchanged)]
 
 impersonationTLSCertificateSecret: pinniped-concierge-impersonation-proxy-tls-serving-certificate
 impersonationCACertificateSecret: pinniped-concierge-impersonation-proxy-ca-certificate
 impersonationSignerSecret: pinniped-concierge-impersonation-proxy-signer-ca-certificate
 agentServiceAccount: pinniped-concierge-kube-cert-agent
 - labels: {"app": "pinniped-concierge"}
 kubeCertAgent:
 namePrefix: pinniped-concierge-kube-cert-agent-
 image: projects.registry.vmware.com/pinniped/pinniped-server:latest



97 changes: 97 additions & 0 deletions assets/multiline/expected-dyff-spruce.human
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@

files.simple.content
± value change in multiline text (three inserts, three deletions)
 UnChanged line
 - This line will change 1
 + This line changed 1
 UnChanged line
 - This line will change 2
 + This line changed 2
 UnChanged line
 - This line will change 3
 + This line changed 3


files.newline.content
± value change in multiline text (four inserts, four deletions)
 
 - 
 - This line will change 1
 + This line changed 1
 UnChanged line
 
 - This line will change 2
 + This line changed 2
 UnChanged line
 
 
 - 
 Moved line
 + 
 
 
 UnChanged line
 - This line will change 3
 + This line changed 3
 + 
 
 


files.complex.content
± value change in multiline text (two inserts, two deletions)
 Begin line 1
 Begin line 2
 Begin line 3
 Begin line 4
 
 [four lines unchanged)]
 
 PreChange line 1
 PreChange line 2
 PreChange line 3
 PreChange line 4
 - This line will change 1
 - This line will change 2
 + This line changed 1
 + This line changed 2
 PostChange line 1
 PostChange line 2
 PostChange line 3
 PostChange line 4
 
 [three lines unchanged)]
 
 PreAdd line 1
 PreAdd line 2
 PreAdd line 3
 PreAdd line 4
 + This line was added
 + This line was added
 PostAdd line 1
 PostAdd line 2
 PostAdd line 3
 PostAdd line 4
 
 [two lines unchanged)]
 
 PreDelete line 1
 PreDelete line 2
 PreDelete line 3
 PreDelete line 4
 - This line will be deleted
 - This line will be deleted
 - This line will be deleted
 PostDelete line 1
 PostDelete line 2
 PostDelete line 3
 PostDelete line 4
 
 [22 lines unchanged)]
 
 End line 1
 End line 2
 End line 3
 End line 4


100 changes: 100 additions & 0 deletions assets/multiline/from.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
files:
- name: simple
content: |
UnChanged line
This line will change 1
UnChanged line
This line will change 2
UnChanged line
This line will change 3

- name: newline
# + to keep trailing newlines
content: |+


This line will change 1
UnChanged line

This line will change 2
UnChanged line



Moved line


UnChanged line
This line will change 3


- name: complex
content: |
Begin line 1
Begin line 2
Begin line 3
Begin line 4
Truncated line
Truncated line
Truncated line
Truncated line
PreChange line 1
PreChange line 2
PreChange line 3
PreChange line 4
This line will change 1
This line will change 2
PostChange line 1
PostChange line 2
PostChange line 3
PostChange line 4
Truncated line
Truncated line
Truncated line
PreAdd line 1
PreAdd line 2
PreAdd line 3
PreAdd line 4
PostAdd line 1
PostAdd line 2
PostAdd line 3
PostAdd line 4
Truncated line
Truncated line
PreDelete line 1
PreDelete line 2
PreDelete line 3
PreDelete line 4
This line will be deleted
This line will be deleted
This line will be deleted
PostDelete line 1
PostDelete line 2
PostDelete line 3
PostDelete line 4
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
End line 1
End line 2
End line 3
End line 4
99 changes: 99 additions & 0 deletions assets/multiline/to.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
files:
- name: simple
content: |
UnChanged line
This line changed 1
UnChanged line
This line changed 2
UnChanged line
This line changed 3

- name: newline
# + to keep trailing newlines
content: |+

This line changed 1
UnChanged line

This line changed 2
UnChanged line


Moved line



UnChanged line
This line changed 3



- name: complex
content: |
Begin line 1
Begin line 2
Begin line 3
Begin line 4
Truncated line
Truncated line
Truncated line
Truncated line
PreChange line 1
PreChange line 2
PreChange line 3
PreChange line 4
This line changed 1
This line changed 2
PostChange line 1
PostChange line 2
PostChange line 3
PostChange line 4
Truncated line
Truncated line
Truncated line
PreAdd line 1
PreAdd line 2
PreAdd line 3
PreAdd line 4
This line was added
This line was added
PostAdd line 1
PostAdd line 2
PostAdd line 3
PostAdd line 4
Truncated line
Truncated line
PreDelete line 1
PreDelete line 2
PreDelete line 3
PreDelete line 4
PostDelete line 1
PostDelete line 2
PostDelete line 3
PostDelete line 4
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
Truncated line
End line 1
End line 2
End line 3
End line 4
14 changes: 8 additions & 6 deletions assets/testbed/expected-dyff-gopatch.human
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@
+ one, two, three, four, five, six

/multiline (document #1)
± value change
- Yes, + Yes, strings
strings can have multiple
can lines
have
multiple
± value change in multiline text (one insert, one deletion)
- Yes,
- strings
- can
- have
- multiple
+ Yes, strings
+ can have multiple
lines


Expand Down
Loading