From e0b0a5a173eb380e13189ad1f5a54edaa1576cd8 Mon Sep 17 00:00:00 2001 From: Chris Coetzee Date: Thu, 22 Aug 2024 12:32:30 +1000 Subject: [PATCH] Disable git verbose commits and abbreviated rebase commands by default Disabling verbose commits and abbreviated commands in rebase ensures that the `spr_reword_helper` is able to correctly detect and amend commits with a `commit-id`. --- git/realgit/realcmd.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/git/realgit/realcmd.go b/git/realgit/realcmd.go index 2377766..7d6f96b 100644 --- a/git/realgit/realcmd.go +++ b/git/realgit/realcmd.go @@ -59,7 +59,11 @@ func (c *gitcmd) GitWithEditor(argStr string, output *string, editorCmd string) if c.config.User.LogGitCommands { fmt.Printf("> git %s\n", argStr) } - args := []string{"-c", fmt.Sprintf("core.editor=%s", editorCmd)} + args := []string{ + "-c", fmt.Sprintf("core.editor=%s", editorCmd), + "-c", "commit.verbose=false", + "-c", "rebase.abbreviateCommands=false", + } args = append(args, strings.Split(argStr, " ")...) cmd := exec.Command("git", args...) cmd.Dir = c.rootdir