Last active
April 14, 2025 13:54
-
-
Save ruediger/5647207 to your computer and use it in GitHub Desktop.
A collection of additional "custom hunk header" patterns for .gitattributes. This provides better context in the diff hunk header.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.tex diff=tex | |
*.bib diff=bibtex | |
*.c diff=cpp | |
*.h diff=cpp | |
*.c++ diff=cpp | |
*.h++ diff=cpp | |
*.cpp diff=cpp | |
*.hpp diff=cpp | |
*.cc diff=cpp | |
*.hh diff=cpp | |
*.m diff=matlab | |
*.py diff=python | |
*.rb diff=ruby | |
*.php diff=php | |
*.pl diff=perl | |
*.html diff=html | |
*.xhtml diff=html | |
*.f diff=fortran | |
*.lisp diff=lisp | |
*.el diff=lisp | |
*.r diff=rstats | |
*.texi* diff=texinfo | |
*.org diff=orgmode | |
*.rs diff=rust | |
*.pdf diff=pdf | |
*.png diff=exif | |
*.jpg diff=exif | |
*.jpeg diff=exif | |
*.gif diff=exif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[diff "lisp"] | |
xfuncname = "^(\\(.*)$" | |
# xfuncname = "^(\\((cl-)?def(un|macro|method).*)$" | |
[diff "rstats"] | |
xfuncname = "^([a-zA-z.]+ <- function.*)$" | |
[diff "texinfo"] | |
# from http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=blob;f=.gitattributes;h=c3b2926c78c939d94358cc63d051a70d38cfea5d;hb=HEAD | |
xfuncname = "^@node[ \t][ \t]*\\([^,][^,]*\\)" | |
[diff "orgmode"] | |
xfuncname = "^(\\*+.*)$" | |
#[diff "css"] | |
# xfuncname = "^([a-zA-Z#.@][^\\}]*)$" | |
# xfuncname = "^(.*\\{)$" | |
[diff "rust"] # Thanks to csabahenk | |
xfuncname = "^[ \t]*(pub|)[ \t]*((fn|struct|enum|impl|trait|mod)[^;]*)$" | |
[diff "exif"] | |
binary = true | |
# sudo apt-get install libimage-exiftool-perl | |
textconv = exiftool | |
[diff "pdf"] | |
textconv = pdftotext-stdout | |
# sudo apt-get install pdftotext | |
# copy the following to a script pdftotext-stdout somehwere in $PATH | |
# #!/bin/bash | |
# pdftotext "$@" - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sadly I have minified files on some repos, and the only interesting stuff there is the size:
Outputs something like: