attr: make attributes depend on file typeattr-filetype
commit9d2536ef30e2dbecf00b178e40a24cb15d5d3d23
authorMichael J Gruber <git@drmicha.warpmail.net>
Mon, 28 Feb 2011 15:10:06 +0000 (28 16:10 +0100)
committerMichael J Gruber <git@drmicha.warpmail.net>
Fri, 18 Mar 2011 15:37:54 +0000 (18 16:37 +0100)
tree9d79907dd7b5d838080fe6f09fa003be8d0db7de
parent4aa7278540f2c67a375cee26edfb39164695d3e8
parent6c1be96ec2132ca32d9dc21884a5777900bbc06c
attr: make attributes depend on file type

This is a whether balloon patch (to check whether this balloons or not,
uhm). Hit it hard, not me ;)

It's part of the way to revive the old idea of making attributes depend
on file type. I am not following the old path

pattern is_symlink otherattr

because that would mean something which looks like an attribute
(is_symlink) but is not. Instead,

symlink:pattern attrs

is to specify attrs for pattern if it is a symlink. So, e.g.,

symlink:* diff=symlink

together with a nice diff.symlink.textconv displays symlinks nicely.
Most notable rough edges:

- git_checkattr() gets a new mode parameter. I've stuck it in where I
  could, 0 anywhere else. This is appropriate in many places (where we
know IS_REG a forteriori) but I'm not sure about all of them.

- We/someone could teach git_checkattr other prefixes.

- It is tested with one (1) symlink and works!

- I would bundle it with Jeff's doc and test ;)

- This is not a real commit message.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>