The Dashboard supports a versioning feature for RightScripts that allows for the comparison of different script revisions, as well as the ability to merge or incorporate those differences onto one of your scripts. When a diff is performed it will not only compare the code body itself, but also the descriptions, attachments, and inputs.
Let's say you decide to use a RightScript that you find under the RightScale tab in one of your Server Templates. In order to customize this RightScript to fit your needs you must first clone it. After making any necessary changes to your private copy, you add it to your Server Template. A few weeks later, a RightScale engineer publishes a new revision of the original RightScript that includes an additional security feature. You want to see what has changed between your customized copy and the newly released revision. After reviewing the changes, you then decide to incorporate them into your script. Your customized RightScript is now up-to-date with what RightScale currently provides.
To compare two RightScripts, go to Design -> RightScripts. Select the RightScript version from the dropdown bar next to the nickname that you want to compare.
Click on the Diff button.

The next window allows you to select which script you would like to compare against. You can select any RightScript that you want, including any revision of that script. By default, the Dashboard will display the previous revision of the script (if available) or the script it was originally cloned from, as the Old Script. In this example, we will compare the customized draft with the original version to see what has changed. Additionally, this functionality can be used to compare two arbitrary scripts by selecting them from the dropdown menus.
Click the Diff button.

Next, a screen will appear that highlights all of the changes between the two scripts.

Colored highlights denote the sections that changed. After inspecting the changes, you may close the window.
Now that you've seen the differences, you would like to incorporate the changes onto your custom RightScript. Since you cannot undo a merge, we recommend committing the HEAD revision of your script. Only HEAD revisions can be merged since they are editable. You cannot perform a merge on a committed revision.
Click Commit. Next, you have the option of leaving a brief comment about your changes. Click Commit again.

Under the dropdown bar you should now see a new revision (rev 1) that you can use or revert back to at a later time.

You are now ready to merge your custom script. Now click the Merge button.

The basic dialog box allows you to perform a three-way merge of RightScripts. By default, the merge will take the changes between the Start, End Script, and current version of your script and merge all the changes to the HEAD version of your script.

If you click the Advanced Options box, you have the option of specifying a To and Destination Script. See the Advanced Merge section below.
To preview the merged script, click the Preview Merge button. As an added safety feature, you cannot merge two scripts without first previewing the proposed merged script.
NOTE: You cannot select which parts of a merge you would like to accept and which parts you want to exclude. The merging feature is an all-or-none change.
If you would like to accept the proposed changes, click Merge.

As an extra safety feature, you'll be asked to confirm once again that you want to accept the merge. Click OK (there will be no more safety warnings).
There may be a scenario where you want to perform a 3-way merge and save it as a new RightScript. For example, if wanted to merge the changes starting at A v1 ending at A v2 to script B [HEAD] and then save the changes as a new script C. See diagram below.

To see the options for performing an advanced merge, click the Advanced Options box. Click the Edit button to select the To Script and Destination Script.
