@@ -113,6 +113,7 @@ static char *sign_commit;
113113static enum {
114114 CLEANUP_SPACE ,
115115 CLEANUP_NONE ,
116+ CLEANUP_SCISSORS ,
116117 CLEANUP_ALL
117118} cleanup_mode ;
118119static const char * cleanup_arg ;
@@ -755,7 +756,9 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
755756 int ident_shown = 0 ;
756757 int saved_color_setting ;
757758 char * ai_tmp , * ci_tmp ;
758- if (whence != FROM_COMMIT )
759+ if (whence != FROM_COMMIT ) {
760+ if (cleanup_mode == CLEANUP_SCISSORS )
761+ wt_status_add_cut_line (s -> fp );
759762 status_printf_ln (s , GIT_COLOR_NORMAL ,
760763 whence == FROM_MERGE
761764 ? _ ("\n"
@@ -771,13 +774,16 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
771774 git_path (whence == FROM_MERGE
772775 ? "MERGE_HEAD"
773776 : "CHERRY_PICK_HEAD" ));
777+ }
774778
775779 fprintf (s -> fp , "\n" );
776780 if (cleanup_mode == CLEANUP_ALL )
777781 status_printf (s , GIT_COLOR_NORMAL ,
778782 _ ("Please enter the commit message for your changes."
779783 " Lines starting\nwith '%c' will be ignored, and an empty"
780784 " message aborts the commit.\n" ), comment_line_char );
785+ else if (cleanup_mode == CLEANUP_SCISSORS && whence == FROM_COMMIT )
786+ wt_status_add_cut_line (s -> fp );
781787 else /* CLEANUP_SPACE, that is. */
782788 status_printf (s , GIT_COLOR_NORMAL ,
783789 _ ("Please enter the commit message for your changes."
@@ -1133,6 +1139,8 @@ static int parse_and_validate_options(int argc, const char *argv[],
11331139 cleanup_mode = CLEANUP_SPACE ;
11341140 else if (!strcmp (cleanup_arg , "strip" ))
11351141 cleanup_mode = CLEANUP_ALL ;
1142+ else if (!strcmp (cleanup_arg , "scissors" ))
1143+ cleanup_mode = use_editor ? CLEANUP_SCISSORS : CLEANUP_SPACE ;
11361144 else
11371145 die (_ ("Invalid cleanup mode %s" ), cleanup_arg );
11381146
@@ -1605,8 +1613,8 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
16051613 die (_ ("could not read commit message: %s" ), strerror (saved_errno ));
16061614 }
16071615
1608- /* Truncate the message just before the diff, if any. */
1609- if ( verbose )
1616+ if ( verbose || /* Truncate the message just before the diff, if any. */
1617+ cleanup_mode == CLEANUP_SCISSORS )
16101618 wt_status_truncate_message_at_cut_line (& sb );
16111619
16121620 if (cleanup_mode != CLEANUP_NONE )
0 commit comments