feat: add --git-commit-no-sign flag

This commit is contained in:
Bede Carroll 2025-05-11 18:40:18 -07:00
parent 3a7efb27b1
commit 294b0faf34
No known key found for this signature in database
2 changed files with 5 additions and 1 deletions

View file

@ -475,7 +475,7 @@ def get_parser(default_config_files, git_root):
"--git-commit-no-sign",
action=argparse.BooleanOptionalAction,
default=False,
help="Disable git signing with --no-gpg-sign (default: False)",
help="Disable git commit signing with --no-gpg-sign (default: False)",
)
group.add_argument(
"--commit",

View file

@ -73,6 +73,7 @@ class GitRepo:
commit_prompt=None,
subtree_only=False,
git_commit_verify=True,
git_commit_no_sign=False,
attribute_co_authored_by=False, # Added parameter
):
self.io = io
@ -89,6 +90,7 @@ class GitRepo:
self.commit_prompt = commit_prompt
self.subtree_only = subtree_only
self.git_commit_verify = git_commit_verify
self.git_commit_no_sign = git_commit_no_sign
self.ignore_file_cache = {}
if git_dname:
@ -277,6 +279,8 @@ class GitRepo:
cmd = ["-m", full_commit_message]
if not self.git_commit_verify:
cmd.append("--no-verify")
if self.git_commit_no_sign:
cmd.append("--no-gpg-sign")
if fnames:
fnames = [str(self.abs_root_path(fn)) for fn in fnames]
for fname in fnames: