Skip to content

Commit

Permalink
8314543: gitattributes: make diffs easier to read
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rybak authored and jyukutyo committed Aug 18, 2023
1 parent 5058854 commit 33d5dfd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 33d5dfd

Please sign in to comment.