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

Re: [PATCH 3/3] notes: don't indent empty lines

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Sep 12, 2021, 05:53 UTC
Message-ID
<CAPig+cTRo_bLrCyhWC5on-HHco=H=3Mc6Xfi4gRP0xVE+Xk=BA@mail.gmail.com>
In-Reply-To
<87wnnn8kba.fsf@evledraar.gmail.com>

On Sat, Sep 11, 2021 at 6:43 AM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:

Show 9 quoted lines
> On Sat, Sep 11 2021, Eric Sunshine wrote:
> > Notes don't store the indented blank lines; it's only at output time,
> > such as with `git format-patch --notes` that the blank lines get
> > indented along with the rest of the note text (just as is happening in
> > your `git show` example in which the entire commit message is being
> > indented, including the blank lines).
>
> Ah, so with your change we'd end up with trimmed notes, but not the
> trimmed main body of the commit message?

That's correct. This "fix" is specific to the note-printing machinery which is invoked by (at least) git-format-patch and git-log.

(Until your demonstration of git-show indentation, I wasn't even aware that blank lines in commit messages were getting indented there, as well.)

Show 8 quoted lines
> > Anyhow, since then, I've discovered that `git format-patch
> > --range-diff` also indents blank lines. And you've now shown that `git
> > show` does, as well, so the behavior which triggered this "fix" turns
> > out to be somewhat normal in this project, rather than a one-off "bug"
> > in need of a fix.
>
> Per the above I wouldn't mind this just being changed for all of them,
> even one at a time.

I'm not a fan of the trailing whitespace either, however, Junio does have the concern that there may be some tooling somewhere which relies upon the "indented blank lines" (even if such tooling would not be robust).

Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 18 of 25 in “suppress trailing whitespace on empty "notes" lines”
  1. 0/3 suppress trailing whitespace on empty "notes" linesEric Sunshine, Aug 30, 2021
  2. 1/3 t3301: tolerate minor notes-related presentation changesEric Sunshine, Aug 30, 2021
  3. Junio C HamanoAug 30, 2021
  4. Eric SunshineAug 30, 2021
  5. 2/3 t3303/t9301: make `notes` tests less brittleEric Sunshine, Aug 30, 2021
  6. 3/3 notes: don't indent empty linesEric Sunshine, Aug 30, 2021
  7. Junio C HamanoAug 30, 2021
  8. Eric SunshineAug 30, 2021
  9. Junio C HamanoAug 30, 2021
  10. Eric SunshineAug 30, 2021
  11. Eric SunshineSep 10, 2021
  12. Eric SunshineSep 10, 2021
  13. Junio C HamanoSep 10, 2021
  14. Eric SunshineSep 10, 2021
  15. Ævar Arnfjörð BjarmasonSep 11, 2021
  16. Eric SunshineSep 11, 2021
  17. Ævar Arnfjörð BjarmasonSep 11, 2021
  18. Eric SunshineSep 12, 2021
  19. Junio C HamanoSep 12, 2021
  20. 0/2 suppress trailing whitespace on empty "notes" linesÆvar Arnfjörð Bjarmason, Aug 30, 2021
  21. 1/2 t3303/t9301: make `notes` tests less brittleÆvar Arnfjörð Bjarmason, Aug 30, 2021
  22. 2/2 notes: don't indent empty linesÆvar Arnfjörð Bjarmason, Aug 30, 2021
  23. Eric SunshineAug 30, 2021
  24. Eric SunshineAug 30, 2021
  25. Junio C HamanoAug 30, 2021

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.