Skip to content

rmac-sifive/wit

 
 

Repository files navigation

GitHub tag (latest SemVer) Build Status Github

Wit

Workspace Integration Tool

What is this?

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.

How does Wit deduplicate packages?

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.

Getting started

The best way to learn wit is to check out the tutorial.

Installation

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.

How To Guides

See the How To Guides for list of guides for common wit operations.

Restore a previous workspace

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

Autocompletion

Tab completion can be enabled via source complete.bash. If you want it to persist, see below.

Bash

Linux

cp complete.bash /etc/bash_completion.d/wit

macOS

Homebrew

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

Zsh

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

GitHub Action

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.

Contributing

Please see README-internals for information about development.

License

See LICENSE.

About

Workspace Integration Tool

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 60.9%
  • Shell 38.0%
  • Other 1.1%