aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: ed491b99160e54e094e9ea80d6e4fa582aee47d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
## What is `ger2err`?

`ger2err` stands for "Gerrit to Errors": it refers to converting Gerrit
review comments into a format which looks like the error output from a
a compiler. Text editors can read this so that you can navigate
through the error list and fix the reviewer comments, as if you were
fixing compiler errors.

## Demo Example

First, set up the environment. Alternatively, these parameters can be passed as
command line arguments. **NOTE** The Gerrit credentials here are not the same as those
used to log in to the Gerrit web interface. These are entirely separate
HTTPS credentials for the API, that you can create inside Gerrit.

Here `$` represents your shell prompt:

    ::shell
    $ export GER2ERR_SERVER=https://your.intranet.local/gerrit
    $ export GER2ERR_USERID=yuzer
    $ export GER2ERR_PASSWORD=ApTKT7YA16sg5cza31mx

Now we can get some comments:

    ::txt
    $ ger2err I62b7e3e79fbeaece243eff2f369b3a90fae9628d
    comments from patch set 1
    lib/parser/scan.c:1357:20: unresolved comment by Co Worker (co.worker)
            Where is this variable initialized?
    lib/parser/parse.y:935:35: unresolved comment by Co Worker (co.worker)
            This doesn't have to be a separate rule; it's a minor
            variation in the foo_phrase grammar production.

This output can be captured and used by your editor. For instance,
a simple way to use it in Vim is to send it to a file called `errors.err`
and then run `vim -q`.  There is a way to do it within Vim.

Each comment consists of a main line which gives the source location
info and identifies the commenter. Then the actual comment lines
follow that, prefixed with a tab character, so they look like
continuation lines.

## Installation

`ger2err` requires TXR 279 or later. It is a hash bang script which uses `env`
to look for `txrlisp` in the `PATH`. Just make it executable and use it.

You can compile it if you want.

    ::txt
    $ txr --compile=ger2err:ger2err.out

Now `ger2err.out` is a compiled version you can install as `ger2err`
instead of the original.

## Documentation

`ger2err` has a `--help` option; that's it.

## License

`ger2err` is offered under a BSD license; see the comment header in the
`ger2err` file.