Log inGet started
Package

history.module

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

world_vcs.history

The reads world.diff, world.show, world.log, world.revParse and the checkout and merge calls build on. world_vcs binds it to itself (bind(worldVcs, callerStageName, workingSet)) once it has defined what the reads use.

  • resolveRev(rev) answers the commit a git-style revision names (HEAD, a branch, origin/<branch>, a commit id or unique prefix, each with ~N / ^ / ^2), raising git's message for one that names nothing; historyHolds(commitId, start?) answers whether a commit is in a branch head's history.
  • commitTreeMap(commitId) answers the full tree at a commit, path to entry; resolveCommitPath(commitId, userPath) resolves a user path in it; walkCommitAncestry, lastWriteCommitFor and pathHistoryFor walk a commit's ancestry; scenesRewrittenBetween(from, to) names the scenes whose scene.json differs between two trees.
  • diffCommitTrees(a, b) diffs two commits by their trees; enumerateChangedPaths and diffPath diff two sources (working, staged, head, commit), diffCandidatePaths names the paths a status read gives a diff to compare (the working-tree rows the ignore rules match only on request), projectDiff(files, mode) puts a diff in its stat or name-only form, and sourceCommitId names the commit a source stands for; stagedActions and resolveStagedContent read the staging area's side.
  • A path's side of a diff is a DiffSide: commitSide builds it from a commit's tree entry, stagedSide from a staged row, workingFileSide from the working tree's bytes and workingFolderSide from a folder asset's recorded version. sameSide and compareSides compare two sides by the version each records, else by content address, else by text, so a binary file is compared like a text one, and sideDiff makes the entry: hunks when both sides hold text, else a binary entry with each side's size.
local History = require("modules.world_vcs.history")
local head = History.resolveRev("HEAD")
for path in pairs(History.commitTreeMap(head)) do print(path) end