Re: [PATCH] gitattributes.txt: mention exceptions to gitignore rules

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

 



On Tue, 04 Jan 2011 20:31:55 +0700, Nguyán ThÃi Ngác Duy wrote:

> gitattr and .gitignore are supposed to use the same rules for matching
> patterns. Unfortunately it's not exactly the same in reality. Mention
> the differences so users won't be surprised, until gitattr gets updates.
> 
> 
> diff --git a/Documentation/gitattributes.txt
> b/Documentation/gitattributes.txt index 5a7f936..cfaf107 100644
> --- a/Documentation/gitattributes.txt +++
> b/Documentation/gitattributes.txt @@ -56,6 +56,7 @@ When more than one
> pattern matches the path, a later line
>  overrides an earlier line.  This overriding is done per attribute.  The
>  rules how the pattern matches paths are the same as in `.gitignore`
>  files; see linkgit:gitignore[5].
> +However patterns that end with a slash is not supported.
>  

I'm afraid that is not all. The rules I've inferred:

  1. No pattern will match directory tree.
  2. It is only possible to match on path components.
  3. If pattern contains slash it is treated as absolute.

Example for file: d1/d2/f1.c

Patterns that match:
  *.c
  d1/d2/*
  /d1/d2/*
  */d2/*
  */*/*

Patterns that do not match but should:
  d2/*
  d2/
  d2
  d1/d2
  /d1/d2


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]