Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit f2fa36d

Browse files
committed
feat: Option to modify commit args before submit
Command line args to be sent to 'git commit' command can be modified just before confirming the commit (after all the text has been written!). Resolve #27
1 parent 6717d85 commit f2fa36d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

gitcommit/gitcommit.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -365,15 +365,13 @@ def run():
365365

366366
# print("\nNOTE: This was a dry run and no commit was made.\n")
367367

368+
# Extra command line arguments for git commit
368369
argv_passthrough = [] # by default add no extra arguments
369-
370-
# Warn of extra command line arguments
371370
if len(sys.argv) > 1:
372-
Ansi.print_warning(
373-
"The following additional arguments will be passed to git commit: ", end=""
374-
)
375-
Ansi.print_warning(sys.argv[1:])
376371
argv_passthrough = sys.argv[1:] # overwrite default list
372+
existing_args = " ".join(argv_passthrough)
373+
text = Ansi.colour(Ansi.fg.bright_yellow, "Extra args for git commit: ")
374+
argv_passthrough = prompt(ANSI(text), default=existing_args).split(" ")
377375

378376
# Ask for confirmation to commit
379377
confirmation_validator = YesNoValidator(answer_required=True)

0 commit comments

Comments
 (0)