diff mbox series

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

Message ID 20230331181229.15255-1-code@khaugsbakk.name (mailing list archive)
State New, archived
Headers show
Series [1/3] doc: interpret-trailers: remove trailing spaces | expand

Commit Message

Kristoffer Haugsbakk March 31, 2023, 6:12 p.m. UTC
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
---
 Documentation/git-interpret-trailers.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Kristoffer Haugsbakk March 31, 2023, 6:21 p.m. UTC | #1
On Fri, Mar 31, 2023, at 20:12, Kristoffer Haugsbakk wrote:
> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>

It seems that my cover letter got denied since it contained non-ascii in the subject.

I’ll re-roll later.
Kristoffer Haugsbakk March 31, 2023, 6:28 p.m. UTC | #2
On Fri, Mar 31, 2023, at 20:21, Kristoffer Haugsbakk wrote:
> I’ll re-roll later.

Interestingly though it worked for the third patch which had the same
subject since it got encoded properly. But I pasted in the same subject
manually in the cover letter.
Junio C Hamano March 31, 2023, 6:46 p.m. UTC | #3
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.
Junio C Hamano March 31, 2023, 7:05 p.m. UTC | #4
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.
diff mbox series

Patch

diff --git a/Documentation/git-interpret-trailers.txt b/Documentation/git-interpret-trailers.txt
index 22ff3a603e..787332771e 100644
--- a/Documentation/git-interpret-trailers.txt
+++ b/Documentation/git-interpret-trailers.txt
@@ -408,9 +408,9 @@  $ git config trailer.see.ifMissing "doNothing"
 $ git config trailer.see.command "git log -1 --oneline --format=\"%h (%s)\" --abbrev-commit --abbrev=14 \$ARG"
 $ git interpret-trailers <<EOF
 > subject
-> 
+>
 > message
-> 
+>
 > see: HEAD~2
 > EOF
 subject
@@ -429,9 +429,9 @@  See-also: fe3187489d69c4 (subject of related commit)
 ------------
 $ sed -e 's/ Z$/ /' >commit_template.txt <<EOF
 > ***subject***
-> 
+>
 > ***message***
-> 
+>
 > Fixes: Z
 > Cc: Z
 > Reviewed-by: Z