Help › Work in notebooks
Keep notebooks in git
Commit notebooks without their results, and keep a text copy of their cells beside them so a review reads the queries.
Querlyn 0.1.0 is not released yet. This help describes it ahead of release.
A notebook saves its results in its file, which is what you want when you send it to someone. In a git repository you may want the opposite: the queries and notes, without results that change at every run and may hold data that should not be in the repository.
Commit a notebook without its results
(, and in the notebook's settings under In git) clears every cell's results, then saves the notebook without any. The file keeps every cell's text, the parameters, the cells' names and the bound its results are saved within; it loses what the cells showed, their run counters and when they ran. Commit it as it is.
To keep the results in the notebook and write a copy without them, asks where to write the copy; the notebook keeps its results and its file.
Keep a text copy for reviews
A notebook's file is JSON, which reads badly in a diff.
(also a
check box in the notebook's settings under In git) makes each save
also write the notebook's cells as one text file beside it: report.sql
beside report.ipynb (.js for a MongoDB notebook, .cql for
Cassandra, .py for a Python notebook). Commit both, and a review reads
the queries as text.
The text copy is in Jupytext's
"percent" format: each cell starts with a -- %% line, text cells are
commented out, and a header names the pairing, so Jupytext and editors that
know the format read it as the notebook's cells. It never holds a result.
Querlyn writes it and does not read it back: change the notebook, not the
copy.
The choice is saved in the notebook (where Jupytext keeps it), so it
follows the notebook. A file of that name beside the notebook that is not
a text copy (your own report.sql) is never replaced: the save says so,
and the notebook is saved all the same.
Help for Querlyn 0.1.0. All help topics