builtin-notes: Add "prune" subcommand for removing notes for missing objects

"git notes prune" will remove all notes that annotate unreachable/non-
existing objects.

The patch includes tests verifying correct behaviour of the new subcommand.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johan Herland
2010-02-13 22:28:28 +01:00
committed by Junio C Hamano
parent 00fbe63627
commit d6576e1fe3
3 changed files with 115 additions and 11 deletions

View File

@ -8,7 +8,7 @@ git-notes - Add/inspect commit notes
SYNOPSIS
--------
[verse]
'git notes' (edit [-F <file> | -m <msg>] | show | remove) [commit]
'git notes' (edit [-F <file> | -m <msg>] | show | remove | prune) [commit]
DESCRIPTION
-----------
@ -37,6 +37,8 @@ remove::
This is equivalent to specifying an empty note message to
the `edit` subcommand.
prune::
Remove all notes for non-existing/unreachable objects.
OPTIONS
-------