Importing a Git project
Initialize a Phasor project from a Git commit. The imported files become the project's code baseline. Intent is then written, or drafted from the existing code and documents, and adopted.
Import a revision
Run phasor import in a new, empty folder. Name a branch, a tag or a commit. The default is HEAD.
mkdir todo cd todo phasor import ../todo-git main Imported Git commit 1e6b20efbef9 into /home/ada/todo: 0 intent files, 2 files of code 2 files of code and 0 files of tests are in .phasor/work/; 0 files of intent at the project root no intent yet: 2 files are baseline code; write intent at the root, or have an agent draft it from README and docs, then adopt
- The files of that commit, its README included, are placed in
.phasor/work/. The project root is reserved for intent. - Only the tree at that commit is imported. Earlier Git history is not.
- The import adopts nothing. The project has no open work, and no record yet relates the imported code to a requirement.
Establish intent
The imported code is a baseline with no intent recorded for it. The project's requirements may well exist elsewhere. Phasor holds none until intent is written and adopted.
- Write it. Put intent files at the project root: what the software does, as its users observe it. Start with the parts that are about to change.
- Have an agent draft it. An agent can read the code, the README and the docs and write intent files from them. Review a draft before you adopt it: adoption makes it the project's requirement.
phasor adopt
Adoption is accepted only from the project's owner: see Adoption. Each adopted file is then open work.
Where the existing code already meets a requirement, the work is closed without a code change. phasor land --outcome no-change records a landing that names the files that implement the requirement, with --binds, and a check already in the record that verifies them, with --check. The check's passing result is evidence that the check passes on the imported code. It does not establish that the code meets the requirement beyond what the check exercises.
Export a Git mirror
phasor export writes the project's history as Git commits, one for each step, into a mirror repository. Running it again adds the steps made since.
phasor export { … the commits written "mirror": "git", "ok": true, "path": "/home/ada/todo/.phasor/git/git", "signed": false, … the tags written }
- The mirror is a bare Git repository. Push it to any Git remote.
--pathwrites into a Git repository you name instead.- The commits are unsigned unless
--signis given. - A release is exported as an annotated Git tag, with the release notes as its message.
- The mirror is one-way. Work done in Git comes back through
phasor import.
Import subsequent Git changes
A commit made in Git after the first import comes in as a draft: its changes are held under a name, and nothing is recorded until the draft is landed, as any other work is.
phasor import ../todo-git feature --draft feature
Imported Git commit 6f0dc28b4e74 as draft feature