Skip to content

Commit 1bced9b

Browse files
authored
[blame] Remove redundant commit hash from results (#967)
[blame] Remove redundant commit hash from results
2 parents dfbeed4 + 3aba88d commit 1bced9b

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## Added
910
- Added BLAME function.
11+
## Fixed
12+
- Removed redundant commit information from BLAME results.
1013

1114
## [0.24.0-rc2] - 2019-10-02
1215

docs/using-gitbase/examples.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ The output will be similar to this:
204204

205205
```sql
206206
SELECT repository_id,
207-
JSON_UNQUOTE(JSON_EXTRACT(bl, "$.commit")),
208207
JSON_UNQUOTE(JSON_EXTRACT(bl, "$.file")),
209208
JSON_UNQUOTE(JSON_EXTRACT(bl, "$.linenum")),
210209
JSON_UNQUOTE(JSON_EXTRACT(bl, "$.author")),

internal/function/blame.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ func (g *BlameGenerator) Next() (interface{}, error) {
5454

5555
l := g.lines[g.curLine]
5656
b := BlameLine{
57-
Commit: g.commit.Hash.String(),
5857
File: g.curFile.Name,
5958
LineNum: g.curLine,
6059
Author: l.Author,
@@ -80,7 +79,6 @@ type (
8079

8180
// BlameLine represents each line of git blame's output
8281
BlameLine struct {
83-
Commit string `json:"commit"`
8482
File string `json:"file"`
8583
LineNum int `json:"linenum"`
8684
Author string `json:"author"`

internal/function/blame_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ func TestBlameEval(t *testing.T) {
4242
testedLine: 0,
4343
lineCount: 12,
4444
expected: BlameLine{
45-
"b029517f6300c2da0f4b651b8642506cd6aaf45d",
4645
".gitignore",
4746
0,
4847
@@ -58,7 +57,6 @@ func TestBlameEval(t *testing.T) {
5857
testedLine: 0,
5958
lineCount: 1,
6059
expected: BlameLine{
61-
"b8e471f58bcbca63b07bda20e428190409c2db47",
6260
"CHANGELOG",
6361
0,
6462

0 commit comments

Comments
 (0)