summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-11-02 21:16:00 +1100
committerJesse Duffield <jessedduffield@gmail.com>2021-11-05 07:58:21 +1100
commitccd80a0e4b87af6d9ada5895c2135736665a9387 (patch)
tree7ffa5b68d1ad7ee7dbc1fd62ee1227c666a8423c /pkg/commands
parent37be9dbea18f52a544a1dd134657c02c1ee61aef (diff)
add menu options for log stuff
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/loading_commits.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/pkg/commands/loading_commits.go b/pkg/commands/loading_commits.go
index a9553c7c0..204e4c9da 100644
--- a/pkg/commands/loading_commits.go
+++ b/pkg/commands/loading_commits.go
@@ -37,7 +37,12 @@ type CommitListBuilder struct {
}
// NewCommitListBuilder builds a new commit list builder
-func NewCommitListBuilder(log *logrus.Entry, gitCommand *GitCommand, osCommand *oscommands.OSCommand, tr *i18n.TranslationSet) *CommitListBuilder {
+func NewCommitListBuilder(
+ log *logrus.Entry,
+ gitCommand *GitCommand,
+ osCommand *oscommands.OSCommand,
+ tr *i18n.TranslationSet,
+) *CommitListBuilder {
return &CommitListBuilder{
Log: log,
GitCommand: gitCommand,
@@ -88,6 +93,8 @@ type GetCommitsOptions struct {
FilterPath string
IncludeRebaseCommits bool
RefName string // e.g. "HEAD" or "my_branch"
+ // determines if we show the whole git graph i.e. pass the '--all' flag
+ All bool
}
func (c *CommitListBuilder) MergeRebasingCommits(commits []*models.Commit) ([]*models.Commit, error) {
@@ -407,12 +414,17 @@ func (c *CommitListBuilder) getLogCmd(opts GetCommitsOptions) *exec.Cmd {
config := c.GitCommand.Config.GetUserConfig().Git.Log
orderFlag := "--" + config.Order
+ allFlag := ""
+ if opts.All {
+ allFlag = " --all"
+ }
return c.OSCommand.ExecutableFromString(
fmt.Sprintf(
- "git log %s %s --oneline %s %s --abbrev=%d %s",
+ "git log %s %s %s --oneline %s %s --abbrev=%d %s",
c.OSCommand.Quote(opts.RefName),
orderFlag,
+ allFlag,
prettyFormat,
limitFlag,
20,