@@ -33,9 +33,11 @@ func getGitCommitCmd(cmd *cobra.Command) []string {
3333 message , _ := cmd .Flags ().GetStringArray ("message" )
3434 flags := cmd .Flags ()
3535 for _ , name := range boolFlags {
36- flag , _ := flags .GetBool (name )
37- if flag {
38- commitCmd = append (commitCmd , "--" + name )
36+ if flags .Lookup (name ).Changed {
37+ flag , err := flags .GetBool (name )
38+ if err == nil && flag {
39+ commitCmd = append (commitCmd , "--" + name )
40+ }
3941 }
4042 }
4143 if noEdit || len (message ) > 0 {
@@ -299,6 +301,7 @@ func init() {
299301 flags .BoolP ("all" , "a" , false , "see the git-commit docs for --all|-a" )
300302 flags .BoolP ("signoff" , "s" , false , "see the git-commit docs for --signoff|-s" )
301303 flags .Bool ("no-gpg-sign" , false , "see the git-commit docs for --no-gpg-sign" )
304+ // FIXME: gpg-sign
302305 flags .Bool ("no-post-rewrite" , false , "Bypass the post-rewrite hook" )
303306 flags .Bool ("no-edit" , false , "Use the selected commit message without launching an editor." )
304307 flags .BoolP ("no-verify" , "n" , false , "Bypass git hooks" )
@@ -313,6 +316,9 @@ func init() {
313316 )
314317 flags .Bool ("init" , false , "initialize a config file if none is present" )
315318 flags .String ("config-format" , "yaml" , "The format of the config file to generate. One of: toml, yml, yaml" )
319+
320+ Cmd .MarkFlagsMutuallyExclusive ("signoff" , "no-signoff" )
321+ Cmd .MarkFlagsMutuallyExclusive ("verify" , "no-verify" )
316322 }
317323 // { // flags for git-cc init
318324 // flags := initCmd.Flags()
0 commit comments