2017-01-12 23:06:23 +00:00
# Grawkit - The Awksome Git Graph Generator [![MIT License][license-svg]][license-url]
2016-10-30 23:17:54 +00:00
Grawkit is a tool that helps build SVG graphs from git command-line descriptions, and is built in Awk.
2017-01-12 23:06:23 +00:00
This tool was created in support of the ["Orthogonal Git Workflow"][orthogonal-git] post. Yes, this took way longer to write than the post itself.
2016-10-30 23:17:54 +00:00
## Testing & Documentation
A `Makefile` is provided for running tests and producing documentation for Grawkit. Run `make help` in the project root for more information.
2019-08-06 11:53:29 +00:00
A full test-suite is provided (depending only on `make` and `awk` ), which should serve as a good example of the existing feature-set. Run it with `make test` .
2016-12-28 22:25:07 +00:00
2019-08-06 11:53:29 +00:00
## Installation
2016-12-28 22:25:07 +00:00
2019-08-06 11:53:29 +00:00
Copy the included `grawkit` AWK script into your local search path (most commonly
2019-08-11 10:29:03 +00:00
`$HOME/.local/bin` ), or just use it directly in this folder. Grawkit should work with most
POSIX-compatible AWK implementations, and has been tested against `gawk` , `nawk` , `busybox awk` , and `goawk` .
2016-12-28 22:25:07 +00:00
2019-08-06 11:53:29 +00:00
## Status & Usage
2016-12-28 22:25:07 +00:00
2019-08-06 11:53:29 +00:00
Grawkit has basic support for common `git` commands such as `git branch` , `git tag` and `git merge` , allowing for fairly complex graphs. The integrated test-suite serves as an example, check the `tests` folder for more.
2016-12-28 22:25:07 +00:00
2019-08-06 11:53:29 +00:00
In order to use this tool, either run the `grawkit` executable against a file containing supported
`git` commands (any command not recognized will be silently ignored), or pass these in standard
input. For instance, given the following file `test.txt` :
2016-12-28 22:25:07 +00:00
2019-08-06 11:53:29 +00:00
```sh
git commit -m "Commit on master"
git commit -m "More stuff"
2016-12-28 22:25:07 +00:00
2019-08-06 11:53:29 +00:00
git branch test-stuff
git checkout test-stuff
2016-12-31 18:19:50 +00:00
2019-08-06 11:53:29 +00:00
git commit -m 'Testing stuff'
2016-12-28 22:25:07 +00:00
git commit
git checkout master
2016-12-31 18:19:50 +00:00
git commit
2019-08-06 11:53:29 +00:00
```
2016-12-31 18:19:50 +00:00
2019-08-06 11:53:29 +00:00
You can execute either:
2016-12-31 18:19:50 +00:00
2019-08-06 12:58:00 +00:00
```sh
2019-08-06 11:53:29 +00:00
cat test.txt | grawkit
# or
grawkit test.txt
```
2016-12-31 18:19:50 +00:00
2019-08-06 11:53:29 +00:00
Which will produce SVG markup to standard output, rendered as:
2016-12-31 18:19:50 +00:00
2019-08-06 12:58:00 +00:00
< p align = "center" > < img
src="https://rawgit.com/deuill/grawkit/892a5cec4dee58838fb18f87fcb00f9d8f4d35a8/tests/03-branch.svg"
alt="" width="300">< / p >
2016-12-28 22:25:07 +00:00
2016-10-30 23:17:54 +00:00
## License
All code in this repository is covered by the terms of the MIT License, the full text of which can be found in the LICENSE file.
2017-01-12 23:06:23 +00:00
[orthogonal-git]: https://deuill.org/post/orthogonal-git-workflow/
2016-10-30 23:17:54 +00:00
[license-url]: https://github.com/deuill/grawkit/blob/master/LICENSE
[license-svg]: https://img.shields.io/badge/license-MIT-blue.svg