{"issue":{"created_at":"2011-12-07T15:21:19Z","state":"open","updated_at":"2011-12-08T18:50:51Z","comments":12,"user":{"gravatar_id":"6804f1775cb4babfcc3851298566fbce","id":42793,"url":"https://api.github.com/users/tanoku","avatar_url":"https://secure.gravatar.com/avatar/6804f1775cb4babfcc3851298566fbce?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"tanoku"},"body":"This is necessary before we can implement a lot of porcelain operations.\r\n\r\nRelevant information regarding `.gitattributes` can be found on the manpage: http://linux.die.net/man/5/gitattributes\r\n\r\nWhat we need is an API based on `git_repository` that takes a path to a file in the repository's working dir and returns its attribute data. This needs to be very *efficient* because it's an operation that will happen often.\r\n\r\nConsider implementing caching layers: note that to obtain the attributes for any given path (e.g. /foo/bar/baz), you must check and compose the attributes in `/foo/bar/.gitattributes`, `/foo/.gitattributes/`, `.gitattributes` and `$GIT_DIR/info/attributes`.\r\n\r\nMAKE IT FAST.\r\n","assignee":null,"id":2475635,"labels":[{"name":"todo","color":"0b02e1","url":"https://api.github.com/repos/libgit2/libgit2/labels/todo"}],"number":508,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"Add `.gitattributes` support","html_url":"https://github.com/libgit2/libgit2/issues/508","closed_at":null,"url":"https://api.github.com/repos/libgit2/libgit2/issues/508","milestone":null},"action":"created","comment":{"created_at":"2011-12-08T18:50:51Z","updated_at":"2011-12-08T18:50:51Z","user":{"gravatar_id":"6804f1775cb4babfcc3851298566fbce","id":42793,"url":"https://api.github.com/users/tanoku","avatar_url":"https://secure.gravatar.com/avatar/6804f1775cb4babfcc3851298566fbce?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"tanoku"},"body":"hm. I'm having a hard time leaning towards any of these APIs. Note that the most common usage by far will be getting a single attribute for a single path, and hence we should make that both the fastest and most accessible case.\r\n\r\nI can't come up with an use case where the user would need to get a list of attributes from a path; if it were up to me, we'd roll with a call to get a single attribute, and a call to get all of them (this one will come in handy for language bindings).","id":3067906,"url":"https://api.github.com/repos/libgit2/libgit2/issues/comments/3067906"}}