Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit f0affc5

Browse files
authored
Merge pull request #294 from ajnavarro/improvement/todos-documentation
Remove TODOs from documentation
2 parents ab6f224 + 9251df1 commit f0affc5

File tree

7 files changed

+22
-16
lines changed

7 files changed

+22
-16
lines changed

blame.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,16 @@ func newLines(contents []string, commits []*object.Commit) ([]*Line, error) {
124124
// this struct is internally used by the blame function to hold its
125125
// inputs, outputs and state.
126126
type blame struct {
127-
path string // the path of the file to blame
128-
fRev *object.Commit // the commit of the final revision of the file to blame
129-
revs []*object.Commit // the chain of revisions affecting the the file to blame
130-
data []string // the contents of the file across all its revisions
131-
graph [][]*object.Commit // the graph of the lines in the file across all the revisions TODO: not all commits are needed, only the current rev and the prev
127+
// the path of the file to blame
128+
path string
129+
// the commit of the final revision of the file to blame
130+
fRev *object.Commit
131+
// the chain of revisions affecting the the file to blame
132+
revs []*object.Commit
133+
// the contents of the file across all its revisions
134+
data []string
135+
// the graph of the lines in the file across all the revisions
136+
graph [][]*object.Commit
132137
}
133138

134139
// calculte the history of a file "path", starting from commit "from", sorted by commit date.
@@ -144,6 +149,7 @@ func (b *blame) fillRevs() error {
144149

145150
// build graph of a file from its revision history
146151
func (b *blame) fillGraphAndData() error {
152+
//TODO: not all commits are needed, only the current rev and the prev
147153
b.graph = make([][]*object.Commit, len(b.revs))
148154
b.data = make([]string, len(b.revs)) // file contents in all the revisions
149155
// for every revision of the file, starting with the first

cli/go-git/upload_pack.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"srcd.works/go-git.v4/plumbing/transport/file"
99
)
1010

11-
//TODO: usage: git upload-pack [--strict] [--timeout=<n>] <dir>
1211
type CmdUploadPack struct {
1312
cmd
1413

@@ -18,6 +17,7 @@ type CmdUploadPack struct {
1817
}
1918

2019
func (CmdUploadPack) Usage() string {
20+
//TODO: usage: git upload-pack [--strict] [--timeout=<n>] <dir>
2121
//TODO: git-upload-pack returns error code 129 if arguments are invalid.
2222
return fmt.Sprintf("usage: %s <git-dir>", os.Args[0])
2323
}

plumbing/protocol/packp/srvresp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ const ackLineLen = 44
1414

1515
// ServerResponse object acknowledgement from upload-pack service
1616
type ServerResponse struct {
17-
// TODO: implement support for multi_ack or multi_ack_detailed responses
1817
ACKs []plumbing.Hash
1918
}
2019

2120
// Decode decodes the response into the struct, isMultiACK should be true, if
2221
// the request was done with multi_ack or multi_ack_detailed capabilities
2322
func (r *ServerResponse) Decode(reader io.Reader, isMultiACK bool) error {
23+
// TODO: implement support for multi_ack or multi_ack_detailed responses
2424
if isMultiACK {
2525
return errors.New("multi_ack and multi_ack_detailed are not supported")
2626
}

plumbing/protocol/packp/updreq.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ var (
1616
// ReferenceUpdateRequest values represent reference upload requests.
1717
// Values from this type are not zero-value safe, use the New function instead.
1818
type ReferenceUpdateRequest struct {
19-
// TODO: Add support for push-cert
2019
Capabilities *capability.List
2120
Commands []*Command
2221
Shallow *plumbing.Hash
@@ -27,6 +26,7 @@ type ReferenceUpdateRequest struct {
2726
// New returns a pointer to a new ReferenceUpdateRequest value.
2827
func NewReferenceUpdateRequest() *ReferenceUpdateRequest {
2928
return &ReferenceUpdateRequest{
29+
// TODO: Add support for push-cert
3030
Capabilities: capability.NewList(),
3131
Commands: nil,
3232
}

plumbing/transport/internal/common/common.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,12 @@ var (
361361
)
362362

363363
// uploadPack implements the git-upload-pack protocol.
364-
//
365-
// TODO support multi_ack mode
366-
// TODO support multi_ack_detailed mode
367-
// TODO support acks for common objects
368-
// TODO build a proper state machine for all these processing options
369364
func uploadPack(w io.WriteCloser, r io.Reader, req *packp.UploadPackRequest) error {
365+
// TODO support multi_ack mode
366+
// TODO support multi_ack_detailed mode
367+
// TODO support acks for common objects
368+
// TODO build a proper state machine for all these processing options
369+
370370
if err := req.UploadRequest.Encode(w); err != nil {
371371
return fmt.Errorf("sending upload-req message: %s", err)
372372
}

plumbing/transport/server/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,8 @@ func setHEAD(s storer.Storer, ar *packp.AdvRefs) error {
406406
return nil
407407
}
408408

409-
//TODO: add peeled references.
410409
func setReferences(s storer.Storer, ar *packp.AdvRefs) error {
410+
//TODO: add peeled references.
411411
iter, err := s.IterReferences()
412412
if err != nil {
413413
return err

references.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ func walkGraph(result *[]*object.Commit, seen *map[plumbing.Hash]struct{}, curre
8282
return nil
8383
}
8484

85-
// TODO: benchmark this making git.object.Commit.parent public instead of using
86-
// an iterator
8785
func parentsContainingPath(path string, c *object.Commit) []*object.Commit {
86+
// TODO: benchmark this method making git.object.Commit.parent public instead of using
87+
// an iterator
8888
var result []*object.Commit
8989
iter := c.Parents()
9090
for {

0 commit comments

Comments
 (0)