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

Re: Git trailing blank lines feature configuration

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 31, 2026, 18:49 UTC
Message-ID
<xmqq33wzc7uy.fsf@gitster.g>
In-Reply-To
<d5ec69c8-e441-4134-a6bb-665fc06db187@kdbg.org>
Johannes Sixt <j6t@kdbg.org> writes:
Show 20 quoted lines
> Am 31.07.26 um 12:19 schrieb Thomas Nemeth:
>>     I have the habit to keep 1 blank line at the end of my files. To me,
>>     it eases the EOF modifications (selecting code blocks, pasting them)
>>     in vim.
>
> (Call this is [x].)
>
>>     Would it be possible to have a configuration option to avoid warnings
>>     (because I see that as a warning) about trailing blank lines ?
> Hearing the first time that an extra blank line at EOF is necessary or
> useful. Would the correct question then perhaps be: how do you all
> handle [x] without an extra blank line at EOF?
>
> That said, are you looking to disable blank-at-eof from core.whitespace?
> Collect all "enabled by default" except this one from [*].
>
> [*]
> https://git-scm.com/docs/git-config#Documentation/git-config.txt-corewhitespace
>
> -- Hannes

Ah, if "I want a configuration that does not complain when it sees any number (including zero) of blank lines" is what is asked for, then yes, 'blank-at-eof' would be sufficient.

I misread the request as "I want it to complain if there is not exactly one blank line at the end" (i.e., zero blank lines will be flagged as not vi-friendly and two or more blank lines will be flagged as excess blank lines at the end). That is not something 'blank-at-eof' would help you achieve.

Previous: Thomas NemethNext: Thomas Nemeth
Message 8 of 10 in “Git trailing blank lines feature configuration”
  1. Thomas NemethJul 31, 2026
  2. Johannes SixtJul 31, 2026
  3. Thomas NemethJul 31, 2026
  4. Ben KnobleAug 1, 2026
  5. Thomas NemethAug 1, 2026
  6. Johannes SixtAug 1, 2026
  7. Thomas NemethAug 2, 2026
  8. Junio C HamanoJul 31, 2026
  9. Thomas NemethAug 1, 2026
  10. Junio C HamanoJul 31, 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.