@@ -26,7 +26,7 @@ static const char * const git_notes_usage[] = {
2626 "git notes [--ref <notes_ref>] edit [<object>]" ,
2727 "git notes [--ref <notes_ref>] show [<object>]" ,
2828 "git notes [--ref <notes_ref>] remove [<object>]" ,
29- "git notes [--ref <notes_ref>] prune" ,
29+ "git notes [--ref <notes_ref>] prune [-n | -v] " ,
3030 NULL
3131};
3232
@@ -67,7 +67,7 @@ static const char * const git_notes_remove_usage[] = {
6767};
6868
6969static const char * const git_notes_prune_usage [] = {
70- "git notes prune" ,
70+ "git notes prune [<options>] " ,
7171 NULL
7272};
7373
@@ -792,7 +792,10 @@ static int remove_cmd(int argc, const char **argv, const char *prefix)
792792static int prune (int argc , const char * * argv , const char * prefix )
793793{
794794 struct notes_tree * t ;
795+ int show_only = 0 , verbose = 0 ;
795796 struct option options [] = {
797+ OPT_BOOLEAN ('n' , NULL , & show_only , "do not remove, show only" ),
798+ OPT_BOOLEAN ('v' , NULL , & verbose , "report pruned notes" ),
796799 OPT_END ()
797800 };
798801
@@ -806,8 +809,10 @@ static int prune(int argc, const char **argv, const char *prefix)
806809
807810 t = init_notes_check ("prune" );
808811
809- prune_notes (t );
810- commit_notes (t , "Notes removed by 'git notes prune'" );
812+ prune_notes (t , (verbose ? NOTES_PRUNE_VERBOSE : 0 ) |
813+ (show_only ? NOTES_PRUNE_VERBOSE |NOTES_PRUNE_DRYRUN : 0 ) );
814+ if (!show_only )
815+ commit_notes (t , "Notes removed by 'git notes prune'" );
811816 free_notes (t );
812817 return 0 ;
813818}
0 commit comments