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

Remove TODOs from documentation #294

Merged
merged 1 commit into from
Mar 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions blame.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,16 @@ func newLines(contents []string, commits []*object.Commit) ([]*Line, error) {
// this struct is internally used by the blame function to hold its
// inputs, outputs and state.
type blame struct {
path string // the path of the file to blame
fRev *object.Commit // the commit of the final revision of the file to blame
revs []*object.Commit // the chain of revisions affecting the the file to blame
data []string // the contents of the file across all its revisions
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
// the path of the file to blame
path string
// the commit of the final revision of the file to blame
fRev *object.Commit
// the chain of revisions affecting the the file to blame
revs []*object.Commit
// the contents of the file across all its revisions
data []string
// the graph of the lines in the file across all the revisions
graph [][]*object.Commit
}

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

// build graph of a file from its revision history
func (b *blame) fillGraphAndData() error {
//TODO: not all commits are needed, only the current rev and the prev
b.graph = make([][]*object.Commit, len(b.revs))
b.data = make([]string, len(b.revs)) // file contents in all the revisions
// for every revision of the file, starting with the first
Expand Down
2 changes: 1 addition & 1 deletion cli/go-git/upload_pack.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"srcd.works/go-git.v4/plumbing/transport/file"
)

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

Expand All @@ -18,6 +17,7 @@ type CmdUploadPack struct {
}

func (CmdUploadPack) Usage() string {
//TODO: usage: git upload-pack [--strict] [--timeout=<n>] <dir>
//TODO: git-upload-pack returns error code 129 if arguments are invalid.
return fmt.Sprintf("usage: %s <git-dir>", os.Args[0])
}
Expand Down
2 changes: 1 addition & 1 deletion plumbing/protocol/packp/srvresp.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ const ackLineLen = 44

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

// Decode decodes the response into the struct, isMultiACK should be true, if
// the request was done with multi_ack or multi_ack_detailed capabilities
func (r *ServerResponse) Decode(reader io.Reader, isMultiACK bool) error {
// TODO: implement support for multi_ack or multi_ack_detailed responses
if isMultiACK {
return errors.New("multi_ack and multi_ack_detailed are not supported")
}
Expand Down
2 changes: 1 addition & 1 deletion plumbing/protocol/packp/updreq.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ var (
// ReferenceUpdateRequest values represent reference upload requests.
// Values from this type are not zero-value safe, use the New function instead.
type ReferenceUpdateRequest struct {
// TODO: Add support for push-cert
Capabilities *capability.List
Commands []*Command
Shallow *plumbing.Hash
Expand All @@ -27,6 +26,7 @@ type ReferenceUpdateRequest struct {
// New returns a pointer to a new ReferenceUpdateRequest value.
func NewReferenceUpdateRequest() *ReferenceUpdateRequest {
return &ReferenceUpdateRequest{
// TODO: Add support for push-cert
Capabilities: capability.NewList(),
Commands: nil,
}
Expand Down
10 changes: 5 additions & 5 deletions plumbing/transport/internal/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,12 @@ var (
)

// uploadPack implements the git-upload-pack protocol.
//
// TODO support multi_ack mode
// TODO support multi_ack_detailed mode
// TODO support acks for common objects
// TODO build a proper state machine for all these processing options
func uploadPack(w io.WriteCloser, r io.Reader, req *packp.UploadPackRequest) error {
// TODO support multi_ack mode
// TODO support multi_ack_detailed mode
// TODO support acks for common objects
// TODO build a proper state machine for all these processing options

if err := req.UploadRequest.Encode(w); err != nil {
return fmt.Errorf("sending upload-req message: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion plumbing/transport/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,8 @@ func setHEAD(s storer.Storer, ar *packp.AdvRefs) error {
return nil
}

//TODO: add peeled references.
func setReferences(s storer.Storer, ar *packp.AdvRefs) error {
//TODO: add peeled references.
iter, err := s.IterReferences()
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions references.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ func walkGraph(result *[]*object.Commit, seen *map[plumbing.Hash]struct{}, curre
return nil
}

// TODO: benchmark this making git.object.Commit.parent public instead of using
// an iterator
func parentsContainingPath(path string, c *object.Commit) []*object.Commit {
// TODO: benchmark this method making git.object.Commit.parent public instead of using
// an iterator
var result []*object.Commit
iter := c.Parents()
for {
Expand Down