@@ -5110,6 +5110,7 @@ static int make_script_with_merges(struct pretty_print_context *pp,
51105110 int keep_empty = flags & TODO_LIST_KEEP_EMPTY ;
51115111 int rebase_cousins = flags & TODO_LIST_REBASE_COUSINS ;
51125112 int root_with_onto = flags & TODO_LIST_ROOT_WITH_ONTO ;
5113+ int skipped_commit = 0 ;
51135114 struct strbuf buf = STRBUF_INIT , oneline = STRBUF_INIT ;
51145115 struct strbuf label = STRBUF_INIT ;
51155116 struct commit_list * commits = NULL , * * tail = & commits , * iter ;
@@ -5160,8 +5161,13 @@ static int make_script_with_merges(struct pretty_print_context *pp,
51605161 oidset_insert (& interesting , & commit -> object .oid );
51615162
51625163 is_empty = is_original_commit_empty (commit );
5163- if (!is_empty && (commit -> object .flags & PATCHSAME ))
5164+ if (!is_empty && (commit -> object .flags & PATCHSAME )) {
5165+ if (flags & TODO_LIST_WARN_SKIPPED_CHERRY_PICKS )
5166+ warning (_ ("skipped previously applied commit %s" ),
5167+ short_commit_name (commit ));
5168+ skipped_commit = 1 ;
51645169 continue ;
5170+ }
51655171 if (is_empty && !keep_empty )
51665172 continue ;
51675173
@@ -5225,6 +5231,9 @@ static int make_script_with_merges(struct pretty_print_context *pp,
52255231 oidcpy (& entry -> entry .oid , & commit -> object .oid );
52265232 oidmap_put (& commit2todo , entry );
52275233 }
5234+ if (skipped_commit )
5235+ advise_if_enabled (ADVICE_SKIPPED_CHERRY_PICKS ,
5236+ _ ("use --reapply-cherry-picks to include skipped commits" ));
52285237
52295238 /*
52305239 * Second phase:
@@ -5345,6 +5354,7 @@ int sequencer_make_script(struct repository *r, struct strbuf *out, int argc,
53455354 const char * insn = flags & TODO_LIST_ABBREVIATE_CMDS ? "p" : "pick" ;
53465355 int rebase_merges = flags & TODO_LIST_REBASE_MERGES ;
53475356 int reapply_cherry_picks = flags & TODO_LIST_REAPPLY_CHERRY_PICKS ;
5357+ int skipped_commit = 0 ;
53485358
53495359 repo_init_revisions (r , & revs , NULL );
53505360 revs .verbose_header = 1 ;
@@ -5380,8 +5390,13 @@ int sequencer_make_script(struct repository *r, struct strbuf *out, int argc,
53805390 while ((commit = get_revision (& revs ))) {
53815391 int is_empty = is_original_commit_empty (commit );
53825392
5383- if (!is_empty && (commit -> object .flags & PATCHSAME ))
5393+ if (!is_empty && (commit -> object .flags & PATCHSAME )) {
5394+ if (flags & TODO_LIST_WARN_SKIPPED_CHERRY_PICKS )
5395+ warning (_ ("skipped previously applied commit %s" ),
5396+ short_commit_name (commit ));
5397+ skipped_commit = 1 ;
53845398 continue ;
5399+ }
53855400 if (is_empty && !keep_empty )
53865401 continue ;
53875402 strbuf_addf (out , "%s %s " , insn ,
@@ -5391,6 +5406,9 @@ int sequencer_make_script(struct repository *r, struct strbuf *out, int argc,
53915406 strbuf_addf (out , " %c empty" , comment_line_char );
53925407 strbuf_addch (out , '\n' );
53935408 }
5409+ if (skipped_commit )
5410+ advise_if_enabled (ADVICE_SKIPPED_CHERRY_PICKS ,
5411+ _ ("use --reapply-cherry-picks to include skipped commits" ));
53945412 return 0 ;
53955413}
53965414
0 commit comments