Add support for parsing git trailers #614

Merged
lollipopman merged 5 commits from trailers into master 2020-06-02 12:30:42 -05:00
1 changed files with 1 additions and 2 deletions
Showing only changes of commit 4764a75274 - Show all commits

View File

@ -34,10 +34,9 @@ func MessageTrailers(message string) ([]Trailer, error) {
lhchavez commented 2020-06-01 20:39:38 -05:00 (Migrated from github.com)
Review

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).
lhchavez commented 2020-06-01 20:39:38 -05:00 (Migrated from github.com)
Review

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).
lhchavez commented 2020-06-01 20:45:12 -05:00 (Migrated from github.com)
Review

maybe

	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 ```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.
lhchavez commented 2020-06-01 20:45:12 -05:00 (Migrated from github.com)
Review

maybe

	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 ```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.
defer C.git_message_trailer_array_free(&trailersC)
trailers := make([]Trailer, trailersC.count)
var trailer *C.git_message_trailer
for i, p := 0, uintptr(unsafe.Pointer(trailersC.trailers)); i < int(trailersC.count); p += unsafe.Sizeof(C.git_message_trailer{}) {
lhchavez commented 2020-06-01 20:39:38 -05:00 (Migrated from github.com)
Review

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).
lhchavez commented 2020-06-01 20:45:12 -05:00 (Migrated from github.com)
Review

maybe

	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 ```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.
for i, p := 0, uintptr(unsafe.Pointer(trailersC.trailers)); i < int(trailersC.count); i, p = i+1, p+unsafe.Sizeof(C.git_message_trailer{}) {
lhchavez commented 2020-06-01 20:39:38 -05:00 (Migrated from github.com)
Review

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).
lhchavez commented 2020-06-01 20:45:12 -05:00 (Migrated from github.com)
Review

maybe

	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 ```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.
trailer = (*C.git_message_trailer)(unsafe.Pointer(p))
trailers[i] = Trailer{Key: C.GoString(trailer.key), Value: C.GoString(trailer.value)}
i++
lhchavez commented 2020-06-01 20:39:38 -05:00 (Migrated from github.com)
Review

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).
lhchavez commented 2020-06-01 20:45:12 -05:00 (Migrated from github.com)
Review

maybe

	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 ```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.
}
return trailers, nil
}

lhchavez commented 2020-06-01 20:39:38 -05:00 (Migrated from github.com)
Review

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).
lhchavez commented 2020-06-01 20:39:38 -05:00 (Migrated from github.com)
Review

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).
lhchavez commented 2020-06-01 20:45:12 -05:00 (Migrated from github.com)
Review

maybe

	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 ```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.
lhchavez commented 2020-06-01 20:45:12 -05:00 (Migrated from github.com)
Review

maybe

	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 ```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.