Add support for parsing git trailers #614
|
@ -19,7 +19,6 @@ type Trailer struct {
|
||||||
|
|||||||
// Trailer structs. Trailers are key/value pairs in the last paragraph of a
|
// Trailer structs. Trailers are key/value pairs in the last paragraph of a
|
||||||
// message, not including any patches or conflicts that may be present.
|
// message, not including any patches or conflicts that may be present.
|
||||||
func MessageTrailers(message string) ([]Trailer, error) {
|
func MessageTrailers(message string) ([]Trailer, error) {
|
||||||
![]() Can the docstrings from libgit2 be copied (+adapted) as the golang docstrings? For example, this could be
Same for Can the docstrings from [libgit2](https://libgit2.org/libgit2/#HEAD/group/message/git_message_trailers) be copied (+adapted) as the golang docstrings? For example, this could be
```go
// MessageTrailers parses trailers out of a message. Trailers are key/value
// pairs in the last paragraph of a message, not including any patches or
// conflicts that may be present.
```
Same for `Trailer` above in L12 (from https://github.com/libgit2/libgit2/blob/849f371ea89257512ef505d0094d77b1ec812c53/include/git2/message.h#L41)
|
|||||||
|
|
||||||
![]() minor nit:
(if this was copied from another file, let me know which one and we'll fix that later). minor nit:
```suggestion
```
(if this was copied from another file, let me know which one and we'll fix that later).
![]() maybe
for a tiny bit more symmetry between the initialization and post-steps. maybe
```suggestion
for i, p := 0, uintptr(unsafe.Pointer(trailersC.trailers)); i < int(trailersC.count); i, p = i + 1, p + unsafe.Sizeof(C.git_message_trailer{}) {
```
for a tiny bit more symmetry between the initialization and post-steps.
|
|||||||
var trailersC C.git_message_trailer_array
|
var trailersC C.git_message_trailer_array
|
||||||
|
|
||||||
messageC := C.CString(message)
|
messageC := C.CString(message)
|
||||||
|
|
||||||
![]() minor nit:
(if this was copied from another file, let me know which one and we'll fix that later). minor nit:
```suggestion
```
(if this was copied from another file, let me know which one and we'll fix that later).
![]() minor nit:
(if this was copied from another file, let me know which one and we'll fix that later). minor nit:
```suggestion
```
(if this was copied from another file, let me know which one and we'll fix that later).
![]() maybe
for a tiny bit more symmetry between the initialization and post-steps. maybe
```suggestion
for i, p := 0, uintptr(unsafe.Pointer(trailersC.trailers)); i < int(trailersC.count); i, p = i + 1, p + unsafe.Sizeof(C.git_message_trailer{}) {
```
for a tiny bit more symmetry between the initialization and post-steps.
![]() maybe
for a tiny bit more symmetry between the initialization and post-steps. maybe
```suggestion
for i, p := 0, uintptr(unsafe.Pointer(trailersC.trailers)); i < int(trailersC.count); i, p = i + 1, p + unsafe.Sizeof(C.git_message_trailer{}) {
```
for a tiny bit more symmetry between the initialization and post-steps.
|
Loading…
Reference in New Issue
minor nit:
(if this was copied from another file, let me know which one and we'll fix that later).
minor nit:
(if this was copied from another file, let me know which one and we'll fix that later).
maybe
for a tiny bit more symmetry between the initialization and post-steps.
maybe
for a tiny bit more symmetry between the initialization and post-steps.