From 5445c78ce13fab97df3d34fdbd40fd80855aa3d9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 14 May 2015 13:11:18 -0400 Subject: more formal spec --- doc/todo/unused_by_refspec.mdwn | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/todo/unused_by_refspec.mdwn b/doc/todo/unused_by_refspec.mdwn index 20b9177da..781425264 100644 --- a/doc/todo/unused_by_refspec.mdwn +++ b/doc/todo/unused_by_refspec.mdwn @@ -17,11 +17,20 @@ departure. Let's allow wildcards as it does, and use leading '+' to add a ref, and '-' to remove. Let the user specify multiple such expressions, separated by ':'. - +refs/heads/*:-refs/remotes/*:+refs/tags/*:-refs/tags/old-tag + +refs/heads/*:+HEAD^:+refs/tags/*:-refs/tags/old-tag -Note that this needs to be processed by taking all refs matching any '+', -and then removing any of those that match any '-' +This is processed by starting with an empty set of refs, and walking the +refspec in order. -Also, allow use of HEAD, and anything else that `git show-ref` can handle. +* Each + is matched against all known refs (from `git show-ref`), and adds + everything it matches to the set. If the + does not contain a wildcard, + it is literally added to the set, rather than looking in the known refs. + This allows "+refs/heads/*" to match all heads, and "+HEAD" + to match HEAD, or even "+sha" to match a given SHA, or "+HEAD^" to match + the previous head. +* Each - is matched against the contents of the set, and removes everything + it matches, using a lexographic matching with wildcards (not looking at + the SHAs that the refs point to, so -refs/heads/master does not remove + +HEAD). --[[Joey]] -- cgit v1.2.3