Re: [PATCH 0/6] Improved infrastructure for refname normalization
flat view
From: Michael Haggerty <hidden>
Date: 2016-06-15 22:52:00
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/