summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
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,