README.md: Simplify and improve examples and usage information

This commit is contained in:
Alex Palaistras 2019-08-06 12:53:29 +01:00
parent 892a5cec4d
commit 9357d4b942
1 changed files with 23 additions and 82 deletions

105
README.md
View File

@ -8,24 +8,23 @@ This tool was created in support of the ["Orthogonal Git Workflow"][orthogonal-g
A `Makefile` is provided for running tests and producing documentation for Grawkit. Run `make help` in the project root for more information.
A full test-suite is provided (depending only on `make` and `awk`), which should serve as a good example of the existing feature-set.
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`.
## Status & Examples
## Installation
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, presented here:
Copy the included `grawkit` AWK script into your local search path (most commonly
`$HOME/.local/bin`), or just use it directly in this folder.
<table>
<tr>
<th width="40%">Command-Line</th>
<th>Generated Graph</th>
</tr>
<tr>
<th><pre><code>git commit -m "Adding a new commit"
git commit</code></pre></th>
<th><img src="https://rawgit.com/deuill/grawkit/b5708197cfcc526498053f9a07565a2d77615054/tests/02-master.svg" alt=""></th>
</tr>
<tr>
<th><pre><code>git commit -m "Commit on master"
## Status & Usage
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.
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`:
```sh
git commit -m "Commit on master"
git commit -m "More stuff"
git branch test-stuff
@ -35,78 +34,20 @@ git commit -m 'Testing stuff'
git commit
git checkout master
git commit</code></pre></th>
<th><img src="https://rawgit.com/deuill/grawkit/b5708197cfcc526498053f9a07565a2d77615054/tests/03-branch.svg" alt=""></th>
</tr>
<tr>
<th><pre><code>git branch test-merging
git commit -m "Commit on master"
git commit -m "Still on master"
git checkout test-merging
git commit -m 'A sample commit'
git checkout master
git commit -m "Another master commit"
git merge test-merging</code></pre></th>
<th><img src="https://rawgit.com/deuill/grawkit/b5708197cfcc526498053f9a07565a2d77615054/tests/04-merge.svg" alt=""></th>
</tr>
<tr>
<th><pre><code>git commit -m "Commit on master"
git branch test-first
git branch test-second
git commit -m "Still on master"
git tag v.1.0.0
git checkout test-first
git commit
```
git branch test-third
You can execute either:
git checkout test-second
git commit
git merge test-first
git tag v.2.0.0-rc1
```
cat test.txt | grawkit
# or
grawkit test.txt
```
git checkout master
git merge test-second
Which will produce SVG markup to standard output, rendered as:
git checkout test-third
git commit</code></pre></th>
<th><img src="https://rawgit.com/deuill/grawkit/b5708197cfcc526498053f9a07565a2d77615054/tests/05-multi-branch.svg" alt=""></th>
</tr>
<tr>
<th><pre><code>git branch develop
git checkout develop
git commit
git branch feature/XYZ-12_fix-foo
git checkout feature/XYZ-12_fix-foo
git commit
git commit
git checkout develop
git branch feature/ZZ-704_take-it-to-the-limit
git checkout feature/ZZ-704_take-it-to-the-limit
git commit
git checkout develop
git merge feature/XYZ-12_fix-foo
git branch feature/ABC-66_make-bar
git checkout feature/ABC-66_make-bar
git commit
git commit
git checkout develop
git merge feature/ZZ-704_take-it-to-the-limit</code></pre></th>
<th><img src="https://rawgit.com/deuill/grawkit/b5708197cfcc526498053f9a07565a2d77615054/tests/06-feature-branch.svg" alt=""></th>
</tr>
</table>
<img src="https://rawgit.com/deuill/grawkit/892a5cec4dee58838fb18f87fcb00f9d8f4d35a8/tests/03-branch.svg" alt="">
## License