git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Windl, Ulrich
Message 4 of 4 in “git context diff does not recognize shell function name”
  1. Windl, UlrichNov 12, 2026
  2. Junio C HamanoNov 12, 2026
  3. Windl, UlrichNov 13, 2026
  4. Johannes SixtNov 14, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.