From: Junio C Hamano Date: Wed, 11 Jan 2017 18:15:27 GMT Subject: Re: [PATCH 2/2] diff: document the pattern format for diff.orderFile Message-ID: In-Reply-To: <21b416ae-8bf6-4f82-25d3-e51a574e7746@google.com> Richard Hansen writes: > On 2017-01-10 21:46, Junio C Hamano wrote: >> Richard Hansen writes: >> >>> 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.