From 33d5dfdab3098549366088c43797bdcaebe02cd6 Mon Sep 17 00:00:00 2001 From: Andrei Rybak Date: Fri, 18 Aug 2023 07:48:50 +0000 Subject: [PATCH] 8314543: gitattributes: make diffs easier to read Git supports special hunk headers for several languages in diff output, which make it easier to read diffs of files in that language, generated by Git (git-diff, git-show, `git log -p`, etc). For details, see `git help gitattributes` or the online documentation.[1] Add entries to the root .gitattributes file to support showing the hunk headers for Java, C, C++, Markdown, Shell script, HTML, and CSS. This makes it easier to read diffs generated by Git. [1] https://git-scm.com/docs/gitattributes Reviewed-by: erikj, ksakata --- .gitattributes | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitattributes b/.gitattributes index 77450626296..ebb586628c3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,10 @@ * -text +*.java diff=java +*.c diff=cpp +*.h diff=cpp +*.cpp diff=cpp +*.hpp diff=cpp +*.md diff=markdown +*.sh diff=bash +*.html diff=html +*.css diff=css