diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2021-11-02 21:16:00 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-11-05 07:58:21 +1100 |
commit | ccd80a0e4b87af6d9ada5895c2135736665a9387 (patch) | |
tree | 7ffa5b68d1ad7ee7dbc1fd62ee1227c666a8423c /pkg/commands/loading_commits.go | |
parent | 37be9dbea18f52a544a1dd134657c02c1ee61aef (diff) |
add menu options for log stuff
Diffstat (limited to 'pkg/commands/loading_commits.go')
-rw-r--r-- | pkg/commands/loading_commits.go | 16 |
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, |