Skip to content

Commit

Permalink
issue #30: extend changelog by contribution diff command
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilsk committed Apr 18, 2021
1 parent fc48373 commit 510514b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
17 changes: 16 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
$ maintainer github contribution lookup /3 # -> now()/3 == now()/-1
```

* Makes a snapshot of contributions for a specified year
* Makes a snapshot of contributions for a specified year or shows changes

```bash
$ maintainer github contribution snapshot 2013 | tee /tmp/snap.01.2013.json | jq
Expand All @@ -67,6 +67,21 @@
...
"2013-12-27T00:00:00Z": 2
}
$ maintainer github contribution diff --base=/tmp/snap.01.2013.json 2013
Day / Week #46 #48 #49 #50
---------------------- --------------- --------------- --------------- -----------
Sunday - - - -
Monday - - - -
Tuesday - - - -
Wednesday +4 - +1 -
Thursday - - - +1
Friday - +2 - -
Saturday - - - -
---------------------- --------------- --------------- --------------- -----------
The diff between head{"/tmp/snap.02.2013.json"} → base{"/tmp/snap.01.2013.json"}
$ maintainer github contribution diff --base=/tmp/snap.01.2013.json --head=/tmp/snap.02.2013.json
```

* Suggests a reasonable date to contribute
Expand Down
19 changes: 17 additions & 2 deletions docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,30 @@
$ maintainer github contribution lookup /3 # -> now()/3 == now()/-1
```

* Makes a snapshot of contributions for a specified year
* Makes a snapshot of contributions for a specified year or shows changes

```bash
$ maintainer github contribution snapshot 2013 | tee snap.2013.json | jq
$ maintainer github contribution snapshot 2013 | tee /tmp/snap.01.2013.json | jq
{
"2013-11-13T00:00:00Z": 1,
...
"2013-12-27T00:00:00Z": 2
}
$ maintainer github contribution diff --base=/tmp/snap.01.2013.json 2013
Day / Week #46 #48 #49 #50
---------------------- --------------- --------------- --------------- -----------
Sunday - - - -
Monday - - - -
Tuesday - - - -
Wednesday +4 - +1 -
Thursday - - - +1
Friday - +2 - -
Saturday - - - -
---------------------- --------------- --------------- --------------- -----------
The diff between head{"/tmp/snap.02.2013.json"} → base{"/tmp/snap.01.2013.json"}
$ maintainer github contribution diff --base=/tmp/snap.01.2013.json --head=/tmp/snap.02.2013.json
```

* Suggests a reasonable date to contribute
Expand Down
1 change: 1 addition & 0 deletions internal/command/github/view/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package view

import (
"fmt"

"github.com/alexeyco/simpletable"

"go.octolab.org/toolset/maintainer/internal/model/github/contribution"
Expand Down

0 comments on commit 510514b

Please sign in to comment.