summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-08-06 21:13:52 +1000
committerJesse Duffield <jessedduffield@gmail.com>2018-08-06 21:13:52 +1000
commita02d3a0c4ee6d5bb8e3365cb7bf7934f9b3a9a77 (patch)
tree092e176391e5ebf4c48d84b8b77c0de39ea9232b
parent3ee9687540e1f365c74d68d7f6cd4185c8b20d19 (diff)
show graph when selecting branch in branch panel
-rw-r--r--branches_panel.go2
-rw-r--r--gitcommands.go11
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() {