Add option to allow --verbose commit in editor commits

This commit is contained in:
Paul Horn 2023-01-01 01:31:46 +01:00
parent cceff63823
commit d98130c3ef
No known key found for this signature in database
GPG key ID: 9361C6F901723B81
4 changed files with 27 additions and 1 deletions

View file

@ -62,7 +62,7 @@ func (self *CommitCommands) CommitCmdObj(message string) oscommands.ICmdObj {
// runs git commit without the -m argument meaning it will invoke the user's editor
func (self *CommitCommands) CommitEditorCmdObj() oscommands.ICmdObj {
return self.cmd.New(fmt.Sprintf("git commit%s", self.signoffFlag()))
return self.cmd.New(fmt.Sprintf("git commit%s%s", self.signoffFlag(), self.verboseFlag()))
}
func (self *CommitCommands) signoffFlag() string {
@ -73,6 +73,14 @@ func (self *CommitCommands) signoffFlag() string {
}
}
func (self *CommitCommands) verboseFlag() string {
if self.UserConfig.Git.Commit.Verbose {
return " --verbose"
} else {
return ""
}
}
// Get the subject of the HEAD commit
func (self *CommitCommands) GetHeadCommitMessage() (string, error) {
message, err := self.cmd.New("git log -1 --pretty=%s").DontLog().RunWithOutput()