This repository was archived by the owner on Sep 11, 2020. It is now read-only.
Add Repository.Log() method (fix #298)#337
Merged
mcuadros merged 2 commits intosrc-d:masterfrom Apr 11, 2017
ajnavarro:repository-log
Merged
Add Repository.Log() method (fix #298)#337mcuadros merged 2 commits intosrc-d:masterfrom ajnavarro:repository-log
mcuadros merged 2 commits intosrc-d:masterfrom
ajnavarro:repository-log
Conversation
Codecov Report
@@ Coverage Diff @@
## master #337 +/- ##
=========================================
- Coverage 77.32% 77.3% -0.03%
=========================================
Files 117 117
Lines 8030 8062 +32
=========================================
+ Hits 6209 6232 +23
- Misses 1160 1164 +4
- Partials 661 666 +5
Continue to review full report at Codecov.
|
mcuadros
suggested changes
Apr 10, 2017
plumbing/object/commit.go
Outdated
| } | ||
|
|
||
| // StorerCommitIter provides an iterator from commits in an EncodedObjectStorer. | ||
| type StorerCommitIter struct { |
Contributor
There was a problem hiding this comment.
this object can be private, since we are using through the interface
plumbing/object/commit.go
Outdated
| // Any non-commit object returned by the storer.EncodedObjectIter is skipped. | ||
| func NewCommitIter(s storer.EncodedObjectStorer, iter storer.EncodedObjectIter) *CommitIter { | ||
| return &CommitIter{iter, s} | ||
| func NewStorerCommitIter(s storer.EncodedObjectStorer, iter storer.EncodedObjectIter) CommitIter { |
Contributor
There was a problem hiding this comment.
If the implementation is private the method can be calle NewCommitIter
plumbing/object/commit.go
Outdated
| }) | ||
| } | ||
|
|
||
| func (iter *StorerCommitIter) Close() { |
plumbing/object/commit.go
Outdated
| @@ -292,9 +290,3 @@ func SortCommits(l []*Commit) { | |||
| s := &commitSorterer{l} | |||
alcortesm
suggested changes
Apr 11, 2017
options.go
Outdated
|
|
||
| // LogOptions describes how a log action should be performed. | ||
| type LogOptions struct { | ||
| // From is the hash of the commit from we want to start the log history. |
Contributor
There was a problem hiding this comment.
Alternative wording:
When the From option is set the log will only contain commits reachable from it. If this option is not set, HEAD will be used as the default From.
- CommitIter is now an interface - The old CommitIter implementation is now called StorerCommitIter - CommitWalker and CommitWalkerPost are now iterators (CommitPreIterator and CommitPostIterator). - Remove Commit.History() method. There are so many ways to iterate a commit history, depending of the use case. Now, instead of use the History() method, you must use CommitPreIterator or CommitPostIterator. - Move commitSorterer to references.go because is the only place that it is used, and it must not be used into another place. - Make References method private, it must only be used into blame logic. - Added a TODO into references method, where the sortCommits is used to remove it in a near future.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.