Skip to content

Commit 354ceae

Browse files
committed
Add README
1 parent bef7a50 commit 354ceae

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Expose gitattributes to emacs buffers
2+
3+
This tool will let you use [git attributes](https://git-scm.com/docs/gitattributes) in Emacs buffers.
4+
5+
In example the following will get the value of a `foo` git attribute for the file associated with the current buffer:
6+
7+
```elisp
8+
(git-attr-get "foo")
9+
```
10+
11+
The `git-attr-get` function will return
12+
13+
* `t` for git attributes with the value "set"
14+
* `nil` for git attributes with the value "unset"
15+
* `'undecided` for git attributes that are "unspecified"
16+
* and the value itself if the git attribute is set to a value
17+
18+
## git-attr-linguist
19+
20+
The `git-attr-linguist` library adds some functions for the git attributes [`linguist-generated`](https://github.com/github/linguist#generated-code) and [`linguist-vendored`](https://github.com/github/linguist#vendored-code).
21+
22+
It adds a `find-file-hook` and upon visiting a file puts the buffer into `git-attr-linguist-generated-mode` and/or `git-attr-linguist-vendored-mode` minor modes.
23+
24+
Both minor modes just puts the buffer into `read-only-mode`.

0 commit comments

Comments
 (0)