From: Michael Haggerty Date: Sat, 10 Sep 2011 03:31:47 GMT Subject: Re: [PATCH 0/6] Improved infrastructure for refname normalization Message-ID: <4E6ADA23.4010800@alum.mit.edu> In-Reply-To: <7vzkidtx81.fsf@alter.siamese.dyndns.org> On 09/09/2011 07:57 PM, Junio C Hamano wrote: > By the way, does this series introduce new infrastructure features that > can be reused in different areas, such as Hui's "alt_odb path > normalization" patch? That code is for normalizing filesystem paths, right? The rules for normalizing filesystem paths are similar to those for refnames (except maybe for stripping the leading "/"). But the validity checks are different, and should be kept separate in case some of the rules need to be tweaked. Since I put the code for validity checks and normalization of refnames in a single function, I don't think it makes sense to share code. It would be possible to separate the validity checks from the normalization, but that would require two scans of the refname. And I think it should be considered rather an accident that filesystem names and refnames have similar conventions (even though there is a strong historical reason for the similarity); they could some day diverge if, say, we started adding support for Windows-native paths. Michael -- Michael Haggerty mhagger@alum.mit.edu http://softwareswirl.blogspot.com/