Re: [EXT] Re: git context diff does not recognize shell function name
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Nov 14, 2026, 08:49 UTC
- Message-ID
- <080eb4e7-2885-4057-b063-2f114b99b883@kdbg.org>
- In-Reply-To
- <69690c3bd37448ff8116bf3497f151a9@ukr.de>
Am 13.11.26 um 08:09 schrieb Windl, Ulrich:
> The file > name ends in ".sh", and there's also a "she-bang" at the start > saying it's a BASH script.
Git does not activate diff drivers automatically for any type of file (AFAIR), so all of these properties are ignored. You have to activate the diff driver yourself, for example, by putting a line like
*.sh diff=bash
in your .git/info/attributes or a .gitattributes. Without this, the default hunk header pattern is used, which picks up lines that begin with a non-punctuation character.
-- Hannes