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

Re: [PATCH 1/3] doc: interpret-trailers: remove trailing spaces

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 31, 2023, 18:46 UTC
Message-ID
<xmqqsfdkep2b.fsf@gitster.g>
In-Reply-To
<20230331181229.15255-1-code@khaugsbakk.name>
Kristoffer Haugsbakk <code@khaugsbakk.name> writes:
Show 10 quoted lines
>  $ git interpret-trailers <<EOF
>  > subject
> -> 
> +>
>  > message
> -> 
> +>
>  > see: HEAD~2
>  > EOF
>  subject

This example pretends as if the above was an interactive session the writer of the documentation did with a shell in a terminal, and these lines are trying to show that each line is prefixed with $PS2 (the secondary prompt string given by the shell for continued lines).

Taking that fact into account, it is arguably more correct to keep these spaces rather than removing them like this patch does, but of course it does not make a practical difference, because these spaces are invisible unless the reader reads the source documentation pages without passing them through AsciiDoc machinery.

The only folks that would be helped by this patch are those of us who edit one of these four lines of the source file (perhaps by replacing '>' with '|', such a patch tries to show use of a different $PS2) and are annoyed to see trailing whitespaces their patch inherited from the original trigger "git diff --check"; I wonder if that is a good enough justification.

I, however, do wonder if we should make our example more friendly to cutting and pasting. And I would not mind it if we got rid of these 4 trailing whitespaces as a side effect of such an effort.

One way to do so, while still pretending to show an actual session with an interactive shell, may be to give the example with an empty string set to $PS2, i.e.

    $ git interpret-trailers <<\EOF
    subject
    message
    see: HEAD~2
    EOF
    subject
    ...

but then it makes it a bit harder to see what is input and what is output. Showing with a separate intermediate file, i.e.

    $ cat sample-message.txt
    subject
    message
    see: HEAD~2
    $ git interpret-trailers <sample-message.txt
    subject
    ...
might make the result slightly easier to follow.  I dunno.
The same comment applies to the other hunk.
Thanks.
Previous: Kristoffer HaugsbakkNext: Junio C Hamano
Message 4 of 33 in “doc: interpret-trailers: remove trailing spaces”
  1. 1/3 doc: interpret-trailers: remove trailing spacesKristoffer Haugsbakk, Mar 31, 2023
  2. Kristoffer HaugsbakkMar 31, 2023
  3. Kristoffer HaugsbakkMar 31, 2023
  4. Junio C HamanoMar 31, 2023
  5. Junio C HamanoMar 31, 2023
  6. 0/3 doc: interpret-trailers: don't use deprecated configKristoffer Haugsbakk, Apr 3, 2023
  7. 0/4 doc: interpret-trailers: don't use deprecated configKristoffer Haugsbakk, Apr 12, 2023
  8. 1/4 doc: interpret-trailers: don’t use heredoc in examplesKristoffer Haugsbakk, Apr 12, 2023
  9. Junio C HamanoApr 12, 2023
  10. 2/4 doc: interpret-trailers: use input redirectionKristoffer Haugsbakk, Apr 12, 2023
  11. Junio C HamanoApr 12, 2023
  12. 3/4 doc: interpret-trailers: don’t use deprecated configKristoffer Haugsbakk, Apr 12, 2023
  13. 4/4 doc: interpret-trailers: fix exampleKristoffer Haugsbakk, Apr 12, 2023
  14. Junio C HamanoApr 12, 2023
  15. 0/4 doc: interpret-trailers: don't use deprecated configKristoffer Haugsbakk, May 1, 2023
  16. 1/4 doc: interpret-trailers: don’t use heredoc in examplesKristoffer Haugsbakk, May 1, 2023
  17. 2/4 doc: interpret-trailers: use input redirectionKristoffer Haugsbakk, May 1, 2023
  18. 3/4 doc: interpret-trailers: don’t use deprecated configKristoffer Haugsbakk, May 1, 2023
  19. 4/4 doc: interpret-trailers: fix exampleKristoffer Haugsbakk, May 1, 2023
  20. Junio C HamanoMay 1, 2023
  21. 2/3 doc: interpret-trailers: don’t use deprecated configKristoffer Haugsbakk, Mar 31, 2023
  22. Andrei RybakApr 1, 2023
  23. 3/3 doc: interpret-trailers: fix exampleKristoffer Haugsbakk, Mar 31, 2023
  24. 1/3 doc: interpret-trailers: don’t use heredoc in examplesKristoffer Haugsbakk, Apr 3, 2023
  25. Junio C HamanoApr 3, 2023
  26. 2/3 doc: interpret-trailers: don’t use deprecated configKristoffer Haugsbakk, Apr 3, 2023
  27. Junio C HamanoApr 3, 2023
  28. Kristoffer HaugsbakkApr 4, 2023
  29. Junio C HamanoApr 4, 2023
  30. ZheNing HuApr 5, 2023
  31. ZheNing HuApr 5, 2023
  32. Kristoffer HaugsbakkApr 5, 2023
  33. 3/3 doc: interpret-trailers: fix examplesKristoffer Haugsbakk, Apr 3, 2023

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.