TimeTravel

CoCalc’s TimeTravel allows you to easily access all revisions of a file. You can use it to see what changes have been made by your collaborators or to recover previous versions after accidental damage. This works for all text-based documents in a Frame Editor, in particular for Jupyter Notebooks, LaTeX Editor, and Sage Worksheets.

To open the TimeTravel frame, click on the light blue button in the upper left:

TimeTravel Button

TimeTravel Button

Then you can use a slider to view previous revisions of the file:

TimeTravel Frame

TimeTravel Frame

Note that you can see changes made by all your collaborators: for each revision the author’s name is shown next to the revision number.

If you decide to Revert the file back to a given revision, it will not undo the history, but will add a new entry at the end. No changes are lost.

You can also view changes between any two revisions:

Changes Between Two Revisions

Changes Between Two Revisions

What Are Revisions?

We have shown you how to look at different revisions, but what are they, and who is responsible for their creation? Unlike with traditional version control systems, such as the well-known Git, these checkpoints are created automatically on a regular basis. In most cases there is no particular “logic” behind their timing, rather it is based on your typing flow and that of your collaborators (or other processes changing files). Whenever the platform detects a change, a new revision is made, and the change is propagated to all currently opened copies of the file for all collaborators. For efficiency reasons, not every single character change is recorded, but you can expect several revisions per sentence.

TimeTravel and Git

If you use TimeTravel to look at revisions of a file that happens to be in a Git repository, you can use Git commits for the file instead of the automatic checkpoints:

Viewing Git Revisions in TimeTravel

Viewing Git Revisions in TimeTravel

Note that Git commits do not replace CoCalc’s automatic checkpoints, rather they complement each other. Here is a real life example from our very own Founder and CEO William Stein:

I screwed up yesterday and realized that I did over a day of hard work on the google pricing calculator, npm published it, but forgot to commit my code to github, and totally deleted my work (I was testing working on a cloud filesystem 2 weeks ago). Also the npm publish’d package only had the autogenerated javascript (not the typescript). After being pretty worried for a while, I realized I did the work on CoCalc, so it had to be in TimeTravel somewhere, and checking around, sure enough, it was easy to recover everything.

Export History

Clicking the Export button generates a machine-readable representation of all changes, summarizing who made them and when exactly. This can be used to track the depth of contributions to a specific file, e.g. students in the context of a group project.

Note that the "user": "Project: ..." is the backend process modifying the file, i.e. that’s not a human person. (See the next section for more information.)

Who Changed My File?

TimeTravel shows who made changes to a file. This is helpful when two or more collaborators have edited a file.

If TimeTravel indicates “The Project” made the change, it means some process other than the CoCalc editor modified the file, and that version was newer than the one used by the editor at that time. This can happen for many reasons. For example, if the file is stored in Git, switching to a different branch could change the contents. Another cause could be running a notebook with JupyterLab or Jupyter classic simultaneously with CoCalc Jupyter.

Clear TimeTravel

Unlike other software (such as Microsoft Office), CoCalc does not store the TimeTravel history of a file in the file itself or within any file system (e.g., it is not in a hidden file). It exists only in the CoCalc backend PostgreSQL database as a series of patches tracking the evolution of your notebook over time. However, TimeTravel is associated to a specific path. If you copy your file to a new location, you will see that its TimeTravel history starts anew.

If you need to completely delete some data including TimeTravel in CoCalc, contact us at help@sagemath.com and we will do it for you. The only copies of data that may remain after administrator deletion are encrypted external backups, not accessible by any CoCalc user.

Privacy Concerns

As explained above, TimeTravel grants you access to a very fine-grained record of everything that each user types in a CoCalc editor. This record is a side effect of real-time collaboration - in order to combine edits from multiple users into a single file, we need to collect incremental changes from all users and then apply them in order. So this track record is directly due to CoCalc being a collaborative platform. We do not use that information for any other purpose and it is not passed to anybody else. You can read more details on our use of customer data including PII in our Privacy Policy.

In a course setting, all instructors and TAs are collaborators on each student project, so they do have access to TimeTravel history. If students work on a group project, they will have access to each other history for that project (it is a single history with records of who made each change). One of the uses by instructors of this history is investigating suspected cheating - if a big chunk of code/text appears in a single TimeTravel record, it was copy-pasted from somewhere rather than actually typed.

There is no way for anyone else to access this information, unless compliance with a legal order is required. This hasn’t happened yet, but it is possible.