summaryrefslogtreecommitdiffhomepage
path: root/.gitattributes (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-10-26Set git diff driver for C source code files.Andrew Clayton1-0/+2
Git can be told to apply language-specific rules when generating diffs. Enable this for C source code files (*.c and *.h) so that function names are printed right. 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: This makes use of the gitattributes(5) infrastructure. Link: <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=218dd85887da3d7d08119de18e9d325fcf30d7a4> Link: <https://git.kernel.org/pub/scm/git/git.git/commit/?id=e82675a040d559c56be54255901138a979eeec21> Reviewed-by: Alejandro Colomar <alx@nginx.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>