Jump to conversation
Unresolved conversations (0)
Nice work!

Nice work!

All of your conversations have been resolved.

Resolved conversations (16)
@wxiaoguang wxiaoguang Mar 31, 2022
```suggestion if trimmed := bytes.TrimSpace(data); len(trimmed) == 0 { // at the moment it seems that there are "\n" before EOF, in such case we do not need to process it // this is a temporary solution to make the parser work correctly. return len(data), trimmed, nil } return len(data), data, nil ``` (if no conclusion, some comments in my mind)
Outdated
modules/git/foreachref/parser.go
wxiaoguang petergardfjall
wxiaoguang and Peter Gardfjäll
@wxiaoguang wxiaoguang Mar 31, 2022
```suggestion if err != nil { _ = stdoutWriter.CloseWithError(ConcatenateError(err, stderr.String())) } else { _ = stdoutWriter.Close() } ``` `stdoutWriter` shouldn't be closed twice
Outdated
modules/git/repo_tag.go
petergardfjall
Peter Gardfjäll
@wxiaoguang wxiaoguang Mar 31, 2022
Why `bytes.TrimSpace` here? Above `return advance, token, nil` doesn't do that.
Outdated
modules/git/foreachref/parser.go
petergardfjall wxiaoguang
Peter Gardfjäll and wxiaoguang
@wxiaoguang wxiaoguang Mar 31, 2022
maybe can make `refDelim` a byte slice `[]byte`, then there is no need to do the type-cast (which needs memory allocation)
Outdated
modules/git/foreachref/parser.go
petergardfjall wxiaoguang
Peter Gardfjäll and wxiaoguang
@lunny lunny Mar 28, 2022
```suggestion payload := fmt.Sprintf("object %s\ntype commit\ntag %s\ntagger %s\n\n%s\n", tag.Object, tag.Name, ref["creator"], strings.TrimSpace(tag.Message)) ```
Outdated
modules/git/repo_tag.go
petergardfjall
Peter Gardfjäll
@lunny lunny Mar 24, 2022
TestParser maybe a better name.
Outdated
modules/git/foreachref/parser_test.go
petergardfjall
Peter Gardfjäll
@lunny lunny Mar 24, 2022
Please place a blank line between internal packages and external packages.
modules/git/foreachref/parser_test.go
petergardfjall
Peter Gardfjäll
@lunny lunny Mar 23, 2022
Maybe we should not delete it but use an insert-update model?
modules/repository/repo.go
petergardfjall
Peter Gardfjäll
@lunny lunny Mar 23, 2022
If the `stdout` maybe very large, we can use `RunWithContext` and use a `io.Pipe` to create a reader for `Parser` and a writer for `Git`.
Outdated
modules/git/repo_tag.go
petergardfjall
Peter Gardfjäll
@lunny lunny Mar 18, 2022
As above
modules/git/foreachref/parser.go
petergardfjall
Peter Gardfjäll
@lunny lunny Mar 18, 2022
Please add copyright head.
modules/git/foreachref/format.go
petergardfjall
Peter Gardfjäll
@petergardfjall petergardfjall Mar 18, 2022
note: this is the main improvement.
modules/repository/repo.go
@petergardfjall petergardfjall Mar 18, 2022
note: unsure of (1) what the payload should look like, (2) if it's even needed in this context. To me it _seemed_ like it was pulled out as part of extracting commit metadata and ended up in the tag also "as a bonus". It _seems_ to me like the payload _could_ be synthesized from the fields, but unsure if it's needed. Would appreciate guidance.
Outdated
modules/git/repo_tag.go
petergardfjall lunny
Peter Gardfjäll and Lunny Xiao
@petergardfjall petergardfjall Mar 18, 2022
note: a bit unsure about need to sort here, guidance appreciated.
Outdated
modules/git/repo_tag.go
petergardfjall lunny
Peter Gardfjäll and Lunny Xiao
@petergardfjall petergardfjall Mar 18, 2022
note: if the overall approach seems reasonable I'll add unit tests for the `Parser` type.
modules/git/foreachref/parser.go
@petergardfjall petergardfjall Mar 18, 2022
note: if the overall approach seems reasonable I'll add unit tests for the `Format` type.
modules/git/foreachref/format.go