Skip to content

Commit ffa2312

Browse files
ac000cakrit
authored andcommitted
Add a .gitattributes file (netdata#6381)
Currently this just sets the git diff driver for C source code files. Git can be told to apply language-specific rules when generating diffs. Enabling this for C source code files (*.c and *.h) means that function names are printed correctly. Specifically, doing so prevents "git diff" from mistakenly considering unindented goto labels as function names. This has the same effect as adding [diff "default"] xfuncname = "^[[:alpha:]$_].*[^:]$" to your git config file. e.g get @@ -10,7 +10,7 @@ int main(void) instead of @@ -10,7 +10,7 @@ again: Signed-off-by: Andrew Clayton <[email protected]>
1 parent 55c8d98 commit ffa2312

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.c diff=cpp
2+
*.h diff=cpp

0 commit comments

Comments
 (0)