aboutsummaryrefslogtreecommitdiffstats
path: root/options.go
diff options
context:
space:
mode:
authorSaeed Rasooli <saeed.gnu@gmail.com>2018-03-05 16:42:58 +0800
committerSaeed Rasooli <saeed.gnu@gmail.com>2018-03-05 16:46:04 +0800
commitd0fcd7136a31f3f693cb63e6e2733435e4240258 (patch)
tree3c06ab44e9eaeb3f92a4759dffef9ba66fef90bb /options.go
parent43fe6601682d13c5b05a1fc0850e5f294e636486 (diff)
downloadgo-git-d0fcd7136a31f3f693cb63e6e2733435e4240258.tar.gz
add LogOrder, LogOptions.Order, implement Order=LogOrderCommitterTime and Order=LogOrderBSF
Signed-off-by: Saeed Rasooli <saeed.gnu@gmail.com>
Diffstat (limited to 'options.go')
-rw-r--r--options.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/options.go b/options.go
index a87b497..f0c2fd8 100644
--- a/options.go
+++ b/options.go
@@ -307,12 +307,27 @@ func (o *ResetOptions) Validate(r *Repository) error {
return nil
}
+type LogOrder int8
+
+const (
+ LogOrderDefault LogOrder = iota
+ LogOrderDFS
+ LogOrderDFSPost
+ LogOrderBSF
+ LogOrderCommitterTime
+)
+
// LogOptions describes how a log action should be performed.
type LogOptions struct {
// 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.
From plumbing.Hash
+
+ // The default traversal algorithm is Depth-first search
+ // set Order=LogOrderCommitterTime for ordering by committer time (more compatible with `git log`)
+ // set Order=LogOrderBSF for Breadth-first search
+ Order LogOrder
}
var (