git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: git@vger.kernel.org, Kristoffer Haugsbakk <code@khaugsbakk.name>
Subject: Re: [PATCH 1/3] doc: interpret-trailers: remove trailing spaces
Date: Fri, 31 Mar 2023 12:05:00 -0700	[thread overview]
Message-ID: <xmqqo7o8eo83.fsf@gitster.g> (raw)
In-Reply-To: <xmqqsfdkep2b.fsf@gitster.g> (Junio C. Hamano's message of "Fri, 31 Mar 2023 11:46:52 -0700")

Junio C Hamano <gitster@pobox.com> writes:

[jc: I forgot to cc the area expert, so here is a forward]

> Kristoffer Haugsbakk <code@khaugsbakk.name> writes:
>
>>  $ 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.

  reply	other threads:[~2023-03-31 19:05 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230331180817.14466-1-code@khaugsbakk.name>
2023-03-31 18:12 ` [PATCH 1/3] doc: interpret-trailers: remove trailing spaces Kristoffer Haugsbakk
2023-03-31 18:21   ` Kristoffer Haugsbakk
2023-03-31 18:28     ` Kristoffer Haugsbakk
2023-03-31 18:46   ` Junio C Hamano
2023-03-31 19:05     ` Junio C Hamano [this message]
2023-04-03 19:21   ` [PATCH v2 0/3] doc: interpret-trailers: don't use deprecated config Kristoffer Haugsbakk
2023-04-12 19:52     ` [PATCH v3 0/4] " Kristoffer Haugsbakk
2023-04-12 19:52       ` [PATCH v3 1/4] doc: interpret-trailers: don’t use heredoc in examples Kristoffer Haugsbakk
2023-04-12 21:16         ` Junio C Hamano
2023-04-12 19:52       ` [PATCH v3 2/4] doc: interpret-trailers: use input redirection Kristoffer Haugsbakk
2023-04-12 21:16         ` Junio C Hamano
2023-04-12 19:52       ` [PATCH v3 3/4] doc: interpret-trailers: don’t use deprecated config Kristoffer Haugsbakk
2023-04-12 19:52       ` [PATCH v3 4/4] doc: interpret-trailers: fix example Kristoffer Haugsbakk
2023-04-12 21:16       ` [PATCH v3 0/4] doc: interpret-trailers: don't use deprecated config Junio C Hamano
2023-05-01 20:02     ` [PATCH v4 " Kristoffer Haugsbakk
2023-05-01 20:02       ` [PATCH v4 1/4] doc: interpret-trailers: don’t use heredoc in examples Kristoffer Haugsbakk
2023-05-01 20:02       ` [PATCH v4 2/4] doc: interpret-trailers: use input redirection Kristoffer Haugsbakk
2023-05-01 20:02       ` [PATCH v4 3/4] doc: interpret-trailers: don’t use deprecated config Kristoffer Haugsbakk
2023-05-01 20:02       ` [PATCH v4 4/4] doc: interpret-trailers: fix example Kristoffer Haugsbakk
2023-05-01 20:59       ` [PATCH v4 0/4] doc: interpret-trailers: don't use deprecated config Junio C Hamano
     [not found]   ` <cover.1680548650.git.code@khaugsbakk.name>
2023-04-03 19:21     ` [PATCH v2 1/3] doc: interpret-trailers: don’t use heredoc in examples Kristoffer Haugsbakk
2023-04-03 20:16       ` Junio C Hamano
2023-04-03 19:22     ` [PATCH v2 2/3] doc: interpret-trailers: don’t use deprecated config Kristoffer Haugsbakk
2023-04-03 21:18       ` Junio C Hamano
2023-04-04 18:02         ` Kristoffer Haugsbakk
2023-04-04 18:37           ` Junio C Hamano
2023-04-05  7:46         ` ZheNing Hu
2023-04-05  7:45       ` ZheNing Hu
2023-04-05  9:09         ` Kristoffer Haugsbakk
2023-04-03 19:22     ` [PATCH v2 3/3] doc: interpret-trailers: fix examples Kristoffer Haugsbakk
2023-03-31 18:14 ` [PATCH 2/3] doc: interpret-trailers: don’t use deprecated config Kristoffer Haugsbakk
2023-04-01  0:22   ` Andrei Rybak
2023-03-31 18:16 ` [PATCH 3/3] doc: interpret-trailers: fix example Kristoffer Haugsbakk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqo7o8eo83.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=christian.couder@gmail.com \
    --cc=code@khaugsbakk.name \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).