Workspace Integration Tool
Wit is a tool for managing workspaces. It is intended as a supplement to (not a replacement for) Git-based workflows. The goal of wit is to enable development in a multiple user and repository environment.
A wit workspace is composed of one or more packages. A package is a git repository. Each package may optionally contain a wit-manifest.json file which defines other packages upon which it depends. Wit resolves this hierarchy of dependencies and generates a flattened directory structure in which each package may exist only once.
When multiple versions of the same package are requested, Wit chooses the latest requested version, making sure the selected version's commit is a descendant of every other requested versions' commits.
The best way to learn wit is to check out the tutorial.
Wake is intended to be as lightweight as possible. It simply requires git
and Python
version 3.5 or greater.
You can use pip
to install:
python3 -m pip install wit-sifive
Or you can simply clone the repo and add it to your PATH
, for example:
git clone https://github.com/sifive/wit.git
PATH=$PATH:$PWD/wit
which wit
It also includes a Makefile
for installing specific versions. The installation flow requires make
, rsync
, and sed
.
make install PREFIX=/path/to/installation
The Makefile will create a directory with the version (it even works for commits between tags) and copy the contents of contents of the local clone excluding the tests and metadata.
See the How To Guides for list of guides for common wit operations.
If you have a matching pair wit-lock.json
and wit-workspace.json
from another workspace, you can create
a new clean workspace by pointing at the previous workspace via the restore
sub-command.
$ wit restore -n <new-workspace-name> -w $OTHER_WS
Dependencies are only specified by the wit-lock.json
file, no other dependency resolution is performed.
If you are keeping your wit-lock.json and wit-workspace.json under revision control you can do an in-place
restore
$ git clone http://example.com/my_workspaces
$ cd my_workspaces/project1
$ ls
wit-lock.json wit-workspace.json
$ wit restore
Tab completion can be enabled via source complete.bash
. If you want it to persist, see below.
cp complete.bash /etc/bash_completion.d/wit
Install autocompletion for bash:
brew install bash-completion
After running the script, you should see instructions for how to finish installing it.
For example, on macOS 10.14.15, the output is:
==> Caveats
Add the following line to your ~/.bash_profile:
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
So, in the above case, we'd add the following to our ~/.bash_profile
:
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
then run:
cp complete.bash /usr/local/etc/bash_completion.d/wit
mkdir -p ~/.zsh/completion
cp complete.bash ~/.zsh/completion/_wit
Make sure the following is in your ~/.zshrc
:
fpath=(~/.zsh/completion $fpath)
autoload -Uz compinit && compinit -i
Then reload your shell:
exec $SHELL -l
This repo also provides a GitHub Action that is available for use in GitHub CI/CD workflows. See actions/wit/README.md for more information.
Please see README-internals for information about development.
See LICENSE.