Re: [PATCH 2/2] diff: document the pattern format for diff.orderFile
From: Junio C Hamano <hidden>
Date: 2017-01-11 18:15:56
Richard Hansen [off-list ref] writes:
On 2017-01-10 21:46, Junio C Hamano wrote:quoted
Richard Hansen [off-list ref] writes:quoted
I was looking at the code to see how the two file formats differed and noticed that match_order() doesn't set the WM_PATHNAME flag when it calls wildmatch(). That's unintentional (a bug), right?It has been that way from day one IIRC even before we introduced wildmatch()---IOW it may be intentional that the current code that uses wildmatch() does not use WM_PATHNAME.You are the original author (af5323e027 2005-05-30). Do you remember what your intention was?
Yes. Back then we didn't even have wildmatch(), and used fnmatch() instead, so forcing FNM_PATHNAME would have meant that people wouldn't be able to say "foo*bar" to match "foo/other/bar"; with wildmatch, "foo**bar" lets you defeat WM_PATHNAME so having WM_PATHNAME always in effect is less of an issue, but with fnmatch(), having FNM_PATHNAME always in effect has a lot of downside. I'd expect that orderfile people have today will be broken and require tweaking if you switched WM_PATHNAME on.