<h2>ssmerge</h2>

This is a utility for merging changes present in two modified versions of a single ancestor spreadsheet.  It is called like this:

  <pre>ssmerge common_ancestor.csv modified_version1.csv modified_version2.csv output.csv</pre>

Decent merging is possible for the following kinds of changes:
<ul>
<li>Reordering of rows.</li>
<li>Addition/removal of rows.</li>
<li>Addition/removal of columns.</li>
<li>Cell changes.</li>
</ul>

Conflicting changes that cannot be resolved are presented on separate rows, with an extra "conflict" column added to signal the status of that row.

Header rows are currently given no special status during merges, and are not required for correct operation.

<h3>Example 1</h3>

Suppose we begin with this spreadsheet:

<sheet>
Altitude,Probe A,Probe B,Probe C,Comment
1000,10,20,30,"Wing vibration"
2000,15,25,52,"Wing vibration"
3000,3,66,89,"Ominous silense"
4000,3,42,12,"Ominous silense"
</sheet>

This spreadsheet gets modified by Alice, who fixes the "silense" typos and adds a row of data:

<sheet>
Altitude,Probe A,Probe B,Probe C,Comment
500,5,10,7,"Smooth flight"
1000,10,20,30,"Wing vibration"
2000,15,25,52,"Wing vibration"
3000,3,66,89,"Ominous silence"
4000,3,42,12,"Ominous silence"
</sheet>

The spreadsheet also gets modified by Bob, who removes Probe B data as unreliable, and adds Probe D data, and also an extra row:

<sheet>
Altitude,Probe A,Probe C,Probe D,Comment
1000,10,30,5,"Wing vibration"
2000,15,52,10,"Wing vibration"
3000,3,89,15,"Ominous silense"
4000,3,12,20,"Ominous silense"
5000,3,16,100,"Severe vibration"
</sheet>

With Coopy, these independent modifications would merge to give:

<sheet>
Altitude,"Probe A","Probe C","Probe D",Comment
500,5,7,,"Smooth flight"
1000,10,30,5,"Wing vibration"
2000,15,52,10,"Wing vibration"
3000,3,89,15,"Ominous silence"
4000,3,12,20,"Ominous silence"
5000,3,16,100,"Severe vibration"
</sheet>

The typos are fixed, the two extra rows are added, and Bob's decisions about Probes B and D have been retained.  This merge works the same way if the header row is removed.

<h3>Example 2</h3>

Let's begin with the same spreadsheet as in Example 1:

<sheet>
Altitude,Probe A,Probe B,Probe C,Comment
1000,10,20,30,"Wing vibration"
2000,15,25,52,"Wing vibration"
3000,3,66,89,"Ominous silense"
4000,3,42,12,"Ominous silense"
</sheet>

This spreadsheet gets modified by Alice, who fixes the "silense" typos and adds a row of data as before:

<sheet>
Altitude,Probe A,Probe B,Probe C,Comment
500,5,10,7,"Smooth flight"
1000,10,20,30,"Wing vibration"
2000,15,25,52,"Wing vibration"
3000,3,66,89,"Ominous silence"
4000,3,42,12,"Ominous silence"
</sheet>

This time, let's suppose Bob independently modifies the spreadsheet to fix the "silense" typos - but he introduces another typo ("silencce") accidentally:

<sheet>
Altitude,Probe A,Probe B,Probe C,Comment
1000,10,20,30,"Wing vibration"
2000,15,25,52,"Wing vibration"
3000,3,66,89,"Ominous silencce"
4000,3,42,12,"Ominous silence"
</sheet>

The result of merging will be a conflict, shown as follows:

<sheet>
[conflict],,,,,
,Altitude,"Probe A","Probe B","Probe C",Comment
,500,5,10,7,"Smooth flight"
,1000,10,20,30,"Wing vibration"
,2000,15,25,52,"Wing vibration"
[local],3000,3,66,89,"Ominous silence"
[conflicting],3000,3,66,89,"Ominous silencce"
,4000,3,42,12,"Ominous silence"
</sheet>

<nowiki>In a conflict, the top-left cell is "[conflict]".  Both versions of conflicting information are given.  Rows and columns that are in conflict are tagged by "[local]" and "[conflicting]" tags.</nowiki>

<h3>Limitations</h3>
<ul>
<li>Currently, only format is supported.</li>
<li>Blank cells may be generated during a merge, which can be a problem if blank cells are interpreted to have a meaning other than "value
</ul>