diff mbox series

MyFirstContribution: render literal *

Message ID pull.1510.git.1680661709616.gitgitgadget@gmail.com (mailing list archive)
State Accepted
Commit 78b6369e6761c04d6aff2d115bafd8845e90e530
Headers show
Series MyFirstContribution: render literal * | expand

Commit Message

Linus Arver April 5, 2023, 2:28 a.m. UTC
From: Linus Arver <linusa@google.com>

The HTML version of MyFirstContribution [1] does not render the
asterisks (*) meant to be typed in as glob patterns by the user, because
they are being interpreted as bold text delimiters.

[1]: Search for "pattern" in
https://git-scm.com/docs/MyFirstContribution#v2-git-send-email

Signed-off-by: Linus Arver <linusa@google.com>
---
    MyFirstContribution: render literal *
    
    Hello! I'm Linus Arver from Google. I'll be contributing toward the
    libification efforts in the near future. Meanwhile, I noticed a
    formatting error in the HTML output of the MyFirstContribution doc
    (hence this patch).
    
    I am also the author of this old patch series from 2014
    [https://lore.kernel.org/git/1407518960-6203-1-git-send-email-linusarver@gmail.com/]
    and am happy to return to hacking on Git. :)

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1510%2Flistx%2Ffix-doc-formatting-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1510/listx/fix-doc-formatting-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1510

 Documentation/MyFirstContribution.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 73876f4861cd3d187a4682290ab75c9dccadbc56

Comments

Felipe Contreras April 5, 2023, 4:30 a.m. UTC | #1
On Tue, Apr 4, 2023 at 9:56 PM Linus Arver via GitGitGadget
<gitgitgadget@gmail.com> wrote:
>
> From: Linus Arver <linusa@google.com>
>
> The HTML version of MyFirstContribution [1] does not render the
> asterisks (*) meant to be typed in as glob patterns by the user, because
> they are being interpreted as bold text delimiters.

Yes, they should be between backticks in order to be interpreted as literals.

Acked-by: Felipe Contreras <felipe.contreras@gmail.com>

>  Documentation/MyFirstContribution.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/MyFirstContribution.txt b/Documentation/MyFirstContribution.txt
> index ccfd0cb5f3e..9c64bf58757 100644
> --- a/Documentation/MyFirstContribution.txt
> +++ b/Documentation/MyFirstContribution.txt
> @@ -1164,7 +1164,7 @@ After you run this command, `format-patch` will output the patches to the `psuh/
>  directory, alongside the v1 patches. Using a single directory makes it easy to
>  refer to the old v1 patches while proofreading the v2 patches, but you will need
>  to be careful to send out only the v2 patches. We will use a pattern like
> -"psuh/v2-*.patch" (not "psuh/*.patch", which would match v1 and v2 patches).
> +`psuh/v2-*.patch` (not `psuh/*.patch`, which would match v1 and v2 patches).

Small nit: with this change we would lose the quotes, which are
helpful, I would rather do "`foo`".

And for what it's worth I would revamp the whole section, something like this:

--- a/Documentation/MyFirstContribution.txt
+++ b/Documentation/MyFirstContribution.txt
@@ -1136,18 +1136,18 @@ information on how to handle comments from reviewers.
 We'll reuse our `psuh` topic branch for v2. Before we make any changes, we'll
 mark the tip of our v1 branch for easy reference:

-----
+....
 $ git checkout psuh
 $ git branch psuh-v1
-----
+....

 Refine your patch series by using `git rebase -i` to adjust commits based upon
 reviewer comments. Once the patch series is ready for submission, generate your
 patches again, but with some new flags:

-----
+....
 $ git format-patch -v2 --cover-letter -o psuh/ --range-diff
master..psuh-v1 master..
-----
+....

 The `--range-diff master..psuh-v1` parameter tells `format-patch` to include a
 range-diff between `psuh-v1` and `psuh` in the cover letter (see
@@ -1157,53 +1157,53 @@ between your v1 and v2 patches.
 The `-v2` parameter tells `format-patch` to output your patches
 as version "2". For instance, you may notice that your v2 patches are
 all named like `v2-000n-my-commit-subject.patch`. `-v2` will also format
-your patches by prefixing them with "[PATCH v2]" instead of "[PATCH]",
-and your range-diff will be prefaced with "Range-diff against v1".
+your patches by prefixing them with "`[PATCH v2]`" instead of "`[PATCH]`",
+and your range-diff will be prefaced with "`Range-diff against v1`".

 After you run this command, `format-patch` will output the patches to
the `psuh/`
 directory, alongside the v1 patches. Using a single directory makes it easy to
 refer to the old v1 patches while proofreading the v2 patches, but
you will need
 to be careful to send out only the v2 patches. We will use a pattern like
-"psuh/v2-*.patch" (not "psuh/*.patch", which would match v1 and v2 patches).
+"`psuh/v2-*.patch`" (not "`psuh/*.patch`", which would match v1 and
v2 patches).

 Edit your cover letter again. Now is a good time to mention what's different
 between your last version and now, if it's something significant. You do not
 need the exact same body in your second cover letter; focus on explaining to
 reviewers the changes you've made that may not be as visible.

-You will also need to go and find the Message-Id of your previous cover letter.
+You will also need to go and find the `Message-ID` of your previous
cover letter.
 You can either note it when you send the first series, from the output of `git
 send-email`, or you can look it up on the
 https://lore.kernel.org/git[mailing list]. Find your cover letter in the
-archives, click on it, then click "permalink" or "raw" to reveal the Message-Id
+archives, click on it, then click "permalink" or "raw" to reveal the
`Message-ID`
 header. It should match:

-----
-Message-Id: <foo.12345.author@example.com>
-----
+....
+Message-ID: <foo.12345.author@example.com>
+....

-Your Message-Id is `<foo.12345.author@example.com>`. This example will be used
-below as well; make sure to replace it with the correct Message-Id for your
-**previous cover letter** - that is, if you're sending v2, use the Message-Id
-from v1; if you're sending v3, use the Message-Id from v2.
+Your `Message-ID` is `<foo.12345.author@example.com>`. This example
will be used
+below as well; make sure to replace it with the correct `Message-ID` for your
+**previous cover letter** - that is, if you're sending v2, use the `Message-ID`
+from v1; if you're sending v3, use the `Message-ID` from v2.

 While you're looking at the email, you should also note who is CC'd, as it's
 common practice in the mailing list to keep all CCs on a thread. You can add
 these CC lines directly to your cover letter with a line like so in the header
 (before the Subject line):

-----
+....
 CC: author@example.com, Othe R <other@example.com>
-----
+....

 Now send the emails again, paying close attention to which messages you pass in
 to the command:

-----
+....
 $ git send-email --to=target@example.com
  --in-reply-to="<foo.12345.author@example.com>"
  psuh/v2-*.patch
-----
+....

 [[single-patch]]
 === Bonus Chapter: One-Patch Changes
Linus Arver April 5, 2023, 5:39 a.m. UTC | #2
Hello Felipe!

Felipe Contreras <felipe.contreras@gmail.com> writes:
> Small nit: with this change we would lose the quotes, which are
> helpful, I would rather do "`foo`".

I see that the doc currently does not quote backticked areas, so this
would be introducing a new style. I think such a change should belong in
a separate patch.

That being said, personally I think having the quotes around the
backticks makes things harder to read, especially for users directly
reading from the raw *.txt file.


> And for what it's worth I would revamp the whole section, something like  
> this:

> --- a/Documentation/MyFirstContribution.txt
> +++ b/Documentation/MyFirstContribution.txt
> @@ -1136,18 +1136,18 @@ information on how to handle comments from  
> reviewers.
>   We'll reuse our `psuh` topic branch for v2. Before we make any changes,  
> we'll
>   mark the tip of our v1 branch for easy reference:

> -----
> +....
>   $ git checkout psuh
>   $ git branch psuh-v1
> -----
> +....


While I see the four dots (....) being used to denote regions in other
files like SubmittingPatches, they are not used at all in
MyFirstContribution.txt. So I am not sure why we would want to change
this.
Felipe Contreras April 5, 2023, 1:22 p.m. UTC | #3
On Wed, Apr 5, 2023 at 12:39 AM Linus Arver <linusa@google.com> wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:

> > And for what it's worth I would revamp the whole section, something like
> > this:
>
> > --- a/Documentation/MyFirstContribution.txt
> > +++ b/Documentation/MyFirstContribution.txt
> > @@ -1136,18 +1136,18 @@ information on how to handle comments from
> > reviewers.
> >   We'll reuse our `psuh` topic branch for v2. Before we make any changes,
> > we'll
> >   mark the tip of our v1 branch for easy reference:
>
> > -----
> > +....
> >   $ git checkout psuh
> >   $ git branch psuh-v1
> > -----
> > +....
>
>
> While I see the four dots (....) being used to denote regions in other
> files like SubmittingPatches, they are not used at all in
> MyFirstContribution.txt. So I am not sure why we would want to change
> this.

"We" probably don't want to change it, *I* do. Because in AsciiDoc
there's a difference between a listing block and a literal block, but
the Git documentation does a very poor job of being compatible with
AsciiDoc anyway. It doesn't even use the modern syntax. So it probably
doesn't matter.

Cheers.
Linus Arver April 5, 2023, 3:58 p.m. UTC | #4
Felipe Contreras <felipe.contreras@gmail.com> writes:

> "We" probably don't want to change it, *I* do. Because in AsciiDoc
> there's a difference between a listing block and a literal block, but
> the Git documentation does a very poor job of being compatible with
> AsciiDoc anyway.

TIL. I'll be happy to apply the listing block -> literal block changes
you suggested in a separate follow-up patch (probably looking at other
docs we have as well, not just for MyFirstContribution.txt).

> It doesn't even use the modern syntax.

I am new to asciidoc; if you know any other examples of modernizations
we can do, feel free to chime in. Thanks.
Felipe Contreras April 6, 2023, 8:52 a.m. UTC | #5
On Wed, Apr 5, 2023 at 10:58 AM Linus Arver <linusa@google.com> wrote:
>
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
> > "We" probably don't want to change it, *I* do. Because in AsciiDoc
> > there's a difference between a listing block and a literal block, but
> > the Git documentation does a very poor job of being compatible with
> > AsciiDoc anyway.
>
> TIL. I'll be happy to apply the listing block -> literal block changes
> you suggested in a separate follow-up patch (probably looking at other
> docs we have as well, not just for MyFirstContribution.txt).
>
> > It doesn't even use the modern syntax.
>
> I am new to asciidoc; if you know any other examples of modernizations
> we can do, feel free to chime in. Thanks.

Unfortunately I cannot recommend you to do any modernizations, because
Git doesn't use modern AsciiDoc: it uses legacy asciiidoc.py.

If you still want to do some modernization, it would have to be
compatible with legacy asciidoc.py, so it would require testing in
both. I tried to explain the differences in [1], but that's not yet
accepted, so I don't know what a documentation writer is supposed to
do at this point.

There's too many considerations to think about before even attempting
to do `make doc`, so I don't know.

Cheers.

[1] https://lore.kernel.org/git/20230405125453.49674-2-felipe.contreras@gmail.com/
Taylor Blau April 6, 2023, 9:14 p.m. UTC | #6
On Wed, Apr 05, 2023 at 02:28:29AM +0000, Linus Arver via GitGitGadget wrote:
> ---
>
>  Documentation/MyFirstContribution.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

For what it's worth, I think that this change is very reasonable and I'd
be happy to see it go forward as-is.

Thanks,
Taylor
diff mbox series

Patch

diff --git a/Documentation/MyFirstContribution.txt b/Documentation/MyFirstContribution.txt
index ccfd0cb5f3e..9c64bf58757 100644
--- a/Documentation/MyFirstContribution.txt
+++ b/Documentation/MyFirstContribution.txt
@@ -1164,7 +1164,7 @@  After you run this command, `format-patch` will output the patches to the `psuh/
 directory, alongside the v1 patches. Using a single directory makes it easy to
 refer to the old v1 patches while proofreading the v2 patches, but you will need
 to be careful to send out only the v2 patches. We will use a pattern like
-"psuh/v2-*.patch" (not "psuh/*.patch", which would match v1 and v2 patches).
+`psuh/v2-*.patch` (not `psuh/*.patch`, which would match v1 and v2 patches).
 
 Edit your cover letter again. Now is a good time to mention what's different
 between your last version and now, if it's something significant. You do not