File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -885,11 +885,21 @@ static void abort_commit(const char *err_msg)
885885 exit (1 );
886886}
887887
888+ static const char merge_editor_comment [] =
889+ N_ ("Please enter a commit message to explain why this merge is necessary,\n"
890+ "especially if it merges an updated upstream into a topic branch.\n"
891+ "\n"
892+ "Lines starting with '#' will be ignored, and an empty message aborts\n"
893+ "the commit.\n" );
894+
888895static void prepare_to_commit (void )
889896{
890897 struct strbuf msg = STRBUF_INIT ;
898+ const char * comment = _ (merge_editor_comment );
891899 strbuf_addbuf (& msg , & merge_msg );
892900 strbuf_addch (& msg , '\n' );
901+ if (0 < option_edit )
902+ strbuf_add_lines (& msg , "# " , comment , strlen (comment ));
893903 write_merge_msg (& msg );
894904 run_hook (get_index_file (), "prepare-commit-msg" ,
895905 git_path ("MERGE_MSG" ), "merge" , NULL , NULL );
You can’t perform that action at this time.
0 commit comments