diff options
author | Jasper Mendiola <jasperduane77@gmail.com> | 2020-07-10 16:22:22 +0800 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-07-10 18:55:00 +1000 |
commit | e89bf5d06b8a90b0aca702c0b9ef570504183cd1 (patch) | |
tree | ae5f6da888822eb8df28b105a86f0dc5871e6c89 | |
parent | e82d2f37a108afbf4abbdcad9ab1da33f927836d (diff) |
add oneline-graph
-rw-r--r-- | docs/Config.md | 1 | ||||
-rw-r--r-- | pkg/commands/git.go | 6 | ||||
-rw-r--r-- | pkg/config/app_config.go | 1 |
3 files changed, 7 insertions, 1 deletions
diff --git a/docs/Config.md b/docs/Config.md index c1548e933..78f504e2c 100644 --- a/docs/Config.md +++ b/docs/Config.md @@ -43,6 +43,7 @@ Default path for the config file: args: "" skipHookPrefix: WIP autoFetch: true + branchLogCmd: "git log --graph --color=always --abbrev-commit --decorate --date=relative --pretty=medium {{branchName}} --" update: method: prompt # can be: prompt | background | never days: 14 # how often an update is checked for diff --git a/pkg/commands/git.go b/pkg/commands/git.go index f7e004108..e6a655782 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -635,7 +635,11 @@ func (c *GitCommand) ShowCmdStr(sha string, filterPath string) string { } func (c *GitCommand) GetBranchGraphCmdStr(branchName string) string { - return fmt.Sprintf("git log --graph --color=always --abbrev-commit --decorate --date=relative --pretty=medium %s --", branchName) + branchLogCmdTemplate := c.Config.GetUserConfig().GetString("git.branchLogCmd") + templateValues := map[string]string{ + "branchName": branchName, + } + return utils.ResolvePlaceholderString(branchLogCmdTemplate, templateValues) } // GetRemoteURL returns current repo remote url diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go index 9938113d7..23fcb7376 100644 --- a/pkg/config/app_config.go +++ b/pkg/config/app_config.go @@ -270,6 +270,7 @@ git: args: "" skipHookPrefix: 'WIP' autoFetch: true + branchLogCmd: "git log --graph --color=always --abbrev-commit --decorate --date=relative --pretty=medium {{branchName}} --" update: method: prompt # can be: prompt | background | never days: 14 # how often a update is checked for |