Liking cljdoc? Tell your friends :D

psosf.diff

Diffs and patches between two PSOSF archives, as a spreadsheet sees them rather than as lines of text.

(diff a b) -> a diff: plain, JSON-shaped data describing every change (patch a d) -> b: the diff applied to the first archive (summary d) -> a short paragraph for people (report d) -> a line-by-line account for people

a and b are archives given as entries (path -> text). A diff is complete: (patch a (diff a b)) reproduces b, written in canonical form. patch checks every change's recorded "from" value and refuses, with an ex-info, when the archive it is given doesn't match.

How changes are found:

  • The manifest is compared field by field.
  • Worksheets are matched by name: added, removed or changed.
  • Columns are matched by header, not position, so adding a column doesn't make every row look changed. A column's type, style and annotation (its directives) are compared, and column order is recorded.
  • Rows are aligned so that an inserted or deleted row is one change, not a change to every row below it. Aligned rows that differ are recorded cell by cell, telling a changed formula from a changed value.
  • Formulas are compared relative to their own cell, as Excel sees them: in row 5, =C5<0 means the same as =C4<0 does in row 4. A formula that only shifted with its row or column is unchanged; patch shifts it back.
  • Tests and signatures are compared by content.

Cells are recorded in their PSOSF field form (psosf:=C2<0, '=literal, 435), so a formula and text that looks like one are never confused. Rows are numbered as in Excel: the header row is row 1, the first row of data row 2.

Diffs and patches between two PSOSF archives, as a spreadsheet sees them
rather than as lines of text.

  (diff a b)        -> a diff: plain, JSON-shaped data describing every change
  (patch a d)       -> b: the diff applied to the first archive
  (summary d)       -> a short paragraph for people
  (report d)        -> a line-by-line account for people

a and b are archives given as entries (path -> text). A diff is complete:
(patch a (diff a b)) reproduces b, written in canonical form. patch checks
every change's recorded "from" value and refuses, with an ex-info, when
the archive it is given doesn't match.

How changes are found:
- The manifest is compared field by field.
- Worksheets are matched by name: added, removed or changed.
- Columns are matched by header, not position, so adding a column doesn't
  make every row look changed. A column's type, style and annotation (its
  directives) are compared, and column order is recorded.
- Rows are aligned so that an inserted or deleted row is one change, not a
  change to every row below it. Aligned rows that differ are recorded cell
  by cell, telling a changed formula from a changed value.
- Formulas are compared relative to their own cell, as Excel sees them: in
  row 5, =C5<0 means the same as =C4<0 does in row 4. A formula that only
  shifted with its row or column is unchanged; patch shifts it back.
- Tests and signatures are compared by content.

Cells are recorded in their PSOSF field form (psosf:=C2<0, '=literal, 435),
so a formula and text that looks like one are never confused. Rows are
numbered as in Excel: the header row is row 1, the first row of data row 2.
raw docstring

detailsclj/s

(details d)
(details d max-items)

A diff for people, in Markdown: for each worksheet, which formulas, data, directives and columns changed, what they changed to, and where, by cell address in the new version. Input worksheets (no formulas, and no directive that produces their rows) give the affected row numbers rather than every value. Each section lists at most max-items changes (default 50).

A diff for people, in Markdown: for each worksheet, which formulas, data,
directives and columns changed, what they changed to, and where, by cell
address in the new version. Input worksheets (no formulas, and no
directive that produces their rows) give the affected row numbers rather
than every value. Each section lists at most max-items changes (default 50).
sourceraw docstring

diffclj/s

(diff entries-a entries-b)

The diff between two archives given as entries. When either can't be read, the diff has "comparable" false, each archive's errors and which files differ, and it can't be applied.

The diff between two archives given as entries. When either can't be read,
the diff has "comparable" false, each archive's errors and which files
differ, and it can't be applied.
sourceraw docstring

diff-archivesclj/s

(diff-archives a b)

The diff between two read archives (psosf.core/read-entries' :archive).

The diff between two read archives (psosf.core/read-entries' :archive).
sourceraw docstring

diff-entriesclj/s

An alias of diff, matching the library's entries-based naming.

An alias of diff, matching the library's entries-based naming.
sourceraw docstring

format-versionclj/s

The version of the diff format, recorded in every diff as "psosf-diff".

The version of the diff format, recorded in every diff as "psosf-diff".
sourceraw docstring

patchclj/s

(patch entries d)

Applies a diff to an archive given as entries, returning the patched archive's entries in canonical form. Throws an ex-info with :psosf/error :patch-conflict when the archive isn't the one the diff was made from.

Applies a diff to an archive given as entries, returning the patched
archive's entries in canonical form. Throws an ex-info with
:psosf/error :patch-conflict when the archive isn't the one the diff was
made from.
sourceraw docstring

patch-archiveclj/s

(patch-archive archive d)

Applies a diff to a read archive, returning the patched archive.

Applies a diff to a read archive, returning the patched archive.
sourceraw docstring

reportclj/s

(report d)
(report d max-rows)

A diff as lines of text for people, with at most max-rows rows per worksheet section (default 20).

A diff as lines of text for people, with at most max-rows rows per
worksheet section (default 20).
sourceraw docstring

summaryclj/s

(summary d)

A diff in a short paragraph for people: for a commit message, a review comment or an agent's report.

A diff in a short paragraph for people: for a commit message, a review
comment or an agent's report.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close