From a02d3a0c4ee6d5bb8e3365cb7bf7934f9b3a9a77 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Mon, 6 Aug 2018 21:13:52 +1000 Subject: [PATCH] show graph when selecting branch in branch panel --- branches_panel.go | 2 +- gitcommands.go | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/branches_panel.go b/branches_panel.go index 8a65719a4..90cb66d8b 100644 --- a/branches_panel.go +++ b/branches_panel.go @@ -90,7 +90,7 @@ func handleBranchSelect(g *gocui.Gui, v *gocui.View) error { } go func() { branch := getSelectedBranch(v) - diff, _ := getBranchDiff(branch.Name, branch.BaseBranch) + diff, _ := getBranchGraph(branch.Name, branch.BaseBranch) renderString(g, "main", diff) }() return nil diff --git a/gitcommands.go b/gitcommands.go index 27e4e8369..d4433b1c3 100644 --- a/gitcommands.go +++ b/gitcommands.go @@ -327,10 +327,15 @@ func sublimeOpenFile(filename string) (string, error) { return runCommand("subl " + filename) } -func getBranchDiff(branch string, baseBranch string) (string, error) { +func getBranchGraph(branch string, baseBranch string) (string, error) { - return runCommand("git log -p -30 --color --no-merges " + branch) - // return runCommand("git diff --color " + baseBranch + "..." + branch) + return runCommand("git log --graph --color --abbrev-commit --decorate --date=relative --pretty=medium " + branch) + + // return runCommand("git log --color --graph --oneline " + branch) + + // Leaving this guy commented out in case there's backlash from the design + // change and I want to make this configurable + // return runCommand("git log -p -30 --color --no-merges " + branch) } func verifyInGitRepo() {