@@ -527,8 +527,9 @@ def git_diff(common):
527527@click .option ('-n' , '--dry-run/--no-dry-run' , is_flag = True , default = False , help = 'Dry run' )
528528@click .option ('-i' , '--interactive/--no-interactive' , is_flag = True , default = True ,
529529 help = 'prompts before copying into each project' )
530+ @click .option ('-m' , '--message' , metavar = 'message' , default = None )
530531@click .argument ('common' , metavar = 'common' , envvar = "COMMON" , nargs = 1 , type = str , required = False )
531- def git_commit (common , dry_run , interactive ):
532+ def git_commit (common , dry_run , interactive , message ):
532533 """
533534 performs a git commit in all projects that have that common file - requires exactly one argument
534535 the message is labelled as 'adopt latest version of <common_file>'
@@ -554,7 +555,10 @@ def git_commit(common, dry_run, interactive):
554555 if not file .has_pending_changes ('index' ):
555556 print (f"skipping project { project } - no pending changes in { common } " )
556557 continue
557- commit_message = f"'adopt latest version of { common .common } '"
558+ if message is not None :
559+ commit_message = f"'{ message } '"
560+ else :
561+ commit_message = f"'adopt latest version of { common .common } '"
558562 command = f"git -C { COMMON_ROOT / project } commit -m{ commit_message } "
559563 print (f"{ 4 * '-' } { project } " )
560564 run_commands ([command ], dry_run = dry_run , interactive = interactive )
0 commit comments