diff options
-rw-r--r-- | blame.go | 16 | ||||
-rw-r--r-- | cli/go-git/upload_pack.go | 2 | ||||
-rw-r--r-- | plumbing/protocol/packp/srvresp.go | 2 | ||||
-rw-r--r-- | plumbing/protocol/packp/updreq.go | 2 | ||||
-rw-r--r-- | plumbing/transport/internal/common/common.go | 10 | ||||
-rw-r--r-- | plumbing/transport/server/server.go | 2 | ||||
-rw-r--r-- | references.go | 4 |
7 files changed, 22 insertions, 16 deletions
@@ -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. @@ -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 diff --git a/cli/go-git/upload_pack.go b/cli/go-git/upload_pack.go index 588e95b..e954d43 100644 --- a/cli/go-git/upload_pack.go +++ b/cli/go-git/upload_pack.go @@ -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 @@ -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]) } diff --git a/plumbing/protocol/packp/srvresp.go b/plumbing/protocol/packp/srvresp.go index 95e1e57..4c1d6db 100644 --- a/plumbing/protocol/packp/srvresp.go +++ b/plumbing/protocol/packp/srvresp.go @@ -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") } diff --git a/plumbing/protocol/packp/updreq.go b/plumbing/protocol/packp/updreq.go index 4337ace..0f6a65a 100644 --- a/plumbing/protocol/packp/updreq.go +++ b/plumbing/protocol/packp/updreq.go @@ -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 @@ -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, } diff --git a/plumbing/transport/internal/common/common.go b/plumbing/transport/internal/common/common.go index ab62a32..d089978 100644 --- a/plumbing/transport/internal/common/common.go +++ b/plumbing/transport/internal/common/common.go @@ -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) } diff --git a/plumbing/transport/server/server.go b/plumbing/transport/server/server.go index 79b64a1..8920351 100644 --- a/plumbing/transport/server/server.go +++ b/plumbing/transport/server/server.go @@ -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 diff --git a/references.go b/references.go index c025df9..fe1d12b 100644 --- a/references.go +++ b/references.go @@ -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 { |