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

Re: [PATCH] docs: link generating patch sections

From
John Cai <johncai86@gmail.com>
Date
Jan 13, 2023, 16:14 UTC
Message-ID
<0DE08530-2F10-4656-9B50-E7B3CBD60D68@gmail.com>
In-Reply-To
<xmqqk030xfrd.fsf@gitster.g>
Hi Junio
On 9 Dec 2022, at 19:29, Junio C Hamano wrote:
Show 18 quoted lines
> "John Cai via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
>> index 3674ac48e92..5acffdd129e 100644
>> --- a/Documentation/diff-options.txt
>> +++ b/Documentation/diff-options.txt
>> @@ -22,7 +22,13 @@ ifndef::git-format-patch[]
>>  -p::
>>  -u::
>>  --patch::
>> -	Generate patch (see section on generating patches).
>> +	Generate patch (see section on
>> +ifdef::git-log[]
>> +<<_generating_patch_text_with_p, generating patches>>).
>
> Is this "prepend underscore, downcase, and replace each run of
> non-alnum with an underscore" ASCIIDoc magic?  AsciiDoctor magic?
> All such backends prepare the anchor in the same format?
Yes, I believe this is asciidoc magic.
Show 8 quoted lines
>
> I am mostly worried about relying on automatic magic that can
> silently be broken when say the title in diff-generate-patch.txt
> file is improved.  Whoever is updating the file would not know
> it is being referenced from elsewhere (and it is hard to check).
>
> Or perhaps you forgot a single liner patch to diff-generate-patch.txt
> that adds [[_generating_patch_text_with_p]] anchor yourself?
Good point, adding an explicit anchor makes sense.
Show 11 quoted lines
>
>> +endif::git-log[]
>> +ifndef::git-log[]
>> +Generate patch text with -p).
>
> The capitalization makes it look somewhat odd in the resulting
> text.  Quoting, e.g.
>
> 	see the section titled "Generate patch text ..."
>
> may make it acceptable, though.
yeah I agree here--I can adjust this in the next version

thanks John

Show 7 quoted lines
>
>> +endif::git-log[]
>>  ifdef::git-diff[]
>>  	This is the default.
>>  endif::git-diff[]
>>
>> base-commit: 2e71cbbddd64695d43383c25c7a054ac4ff86882
Previous: Junio C HamanoNext: John Cai via GitGitGadget
Message 3 of 4 in “docs: link generating patch sections”
  1. docs: link generating patch sectionsJohn Cai via GitGitGadget, Dec 9, 2022
  2. Junio C HamanoDec 10, 2022
  3. John CaiJan 13, 2023
  4. docs: link generating patch sectionsJohn Cai via GitGitGadget, Jan 13, 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.