[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 01/11 v2] gitignore: Move ignores from global to subdirectories



On 10.09.2020 20:22, Elliott Mitchell wrote:
> On Thu, Sep 10, 2020 at 11:13:26AM +0200, Jan Beulich wrote:
>> On 27.08.2020 21:09, Elliott Mitchell wrote:
>>> --- a/tools/misc/.gitignore
>>> +++ b/tools/misc/.gitignore
>>> @@ -1 +1,22 @@
>>> -xen-ucode
>>> +/cpuperf/cpuperf-perfcntr
>>> +/cpuperf/cpuperf-xen
>>> +/lowmemd
>>> +/xc_shadow
>>> +/xen-cpuid
>>> +/xen-detect
>>> +/xen-diag
>>> +/xen-hptool
>>> +/xen-hvmcrash
>>> +/xen-hvmctx
>>> +/xen-livepatch
>>> +/xen-lowmemd
>>> +/xen-mfndump
>>> +/xen-tmem-list-parse
>>> +/xen-ucode
>>> +/xen_cpuperf
>>> +/xencov
>>> +/xenhypfs
>>> +/xenlockprof
>>> +/xenperf
>>> +/xenpm
>>> +/xenwatchdogd
>>
>> The earlier discussion had left me with the impression that the ./
>> form would be slightly better to use to avoid puzzling the
>> occasional reader. Did I overlook or mis-interpret anything? Did you
>> come to the conclusion that / is better, but forgot to mention the
>> "why" in at least the cover letter?
> 
> Some of Xen's documentation isn't that great, even though most of `git`'s
> documentation is quite good a few pieces aren't so great.  The
> information on how .gitignore files are treated is less than wonderful.
> 
> I had *thought* "./" would restrict to capturing files in the current
> directory, but after some testing and then some reading of the
> documentation (oh, `git check-ignore` is a thing).  Then reading the
> documentation again.  Then reading the documentation *again*.  I found an
> initial "/" restricts a pattern to the current directory, but `git`
> doesn't handle "./".
> 
> Apparently a pattern with a slash *anywhere* besides the *end* (which
> includes the very start) will be treated as a full path relative to the
> current directory.  As such "foo/bar" and "/foo/bar" are equivalent.  Yet
> "foo" and "/foo" are *not* equivalent.

But then ./foo and /foo ought to be equivalent, too. Unless of
course the . gets in the way of matching names in the first
place ...

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.