gitattributes: make diffs easier to read

erik.joelsson at erik.joelsson at
Thu Aug 17 13:55:34 UTC 2023

Hello Andrei,

This seems like a reasonable addition to .gitattributes. As far as I'm 
concerned, you can go ahead and create a PR.


On 8/16/23 14:26, Andrei Rybak wrote:
> Hello skara-dev mailing list,
> I would like to propose a change to the root .gitattributes file in the
> main-line JDK repository, which would make Git produce diffs, which are
> slightly nicer to read.  The proposed change is to add:
>     *.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
> to the file.  This list of file extensions and corresponding values for
> attribute "diff" was chosen based on the currently available built in
> patterns for custom hunk-headers.  For details about the "diff" attribute
> and the list of built in patterns see section "Generating diff text" of
> `git help gitattributes`, also available online.[1]
> As far as I can tell, the only other time .gitattributes files were
> edited in the main-line JDK repository is JDK-8241768.[2]  I CC'd people
> involved in the development of that issue.  Mailing list skara-dev seemed
> like the most appropriate place to "Socialize your change".[3] Please do
> let me know if another mailing list is better suited for this proposal.
> The proposed change is also available on GitHub, with an example of
> how these hunk-headers will look like in the commit message.[4]
> [1]
> [2] issue:
>     commit: 
> [3]
> [4] 

More information about the skara-dev mailing list