This repository was archived by the owner on Sep 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 534
Conversation
This file contains 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
8bf7713
to
a758a4e
Compare
Signed-off-by: David Pordomingo <David.Pordomingo.F@gmail.com>
a758a4e
to
d81bffe
Compare
Will be nice to add a README to this example to understand how works |
Would it be enough adding that info to the command itself? Running it wothout no options:
with
|
by the way, wdyt @mcuadros about adding the core of this command ( |
TODO:
|
@mcuadros I think the backing iterators and so on would belong to go-git core, maybe a |
If you want to see how would it look like I can do it in my next OSD (that hopefully would be next Monday) |
superseded by:
|
# for free
to subscribe to this conversation on GitHub.
Already have an account?
#.
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.
Command example implementing
git merge-base
behavior, with--is-ancestor
and--independent
modifiers.usage:
To offer those features, it was implemented a new walker
filterCommitIter
(likebfsCommitIterator
one), and three functionsMergeBase
,IsAncestor
andIndependents
.filterCommitIter
MergeBase(first, second *object.Commit) ([]*object.Commit, error)
IsAncestor(first, second *object.Commit) (bool, error)
Independents(commits []*object.Commit) ([]*object.Commit, error)
alternative:
imo the new feature could be part of
go-git
itself, instead of being an_example
; to do so, I think thatfilterCommitIter
could replacebfsCommitIterator
or be moved intogo-git/plumbing/object
package, andMergeBase
,IsAncestor
andIndependents
could be moved intogit.Repository
struct.If you think it could be feasible as proposed, or with any change, let me know and will work over it during the next OSD 🎉