From ebdc46c242ac53d73295ba8953456b571dbad322 Mon Sep 17 00:00:00 2001 From: John Cai Date: Fri, 13 Jan 2023 16:15:24 +0000 Subject: [PATCH] docs: link generating patch sections Currently, in the git-log documentation, the reference to generating patches does not match the section title. This can make the section "Generating patch text with -p" hard to find, since typically readers of the documentation will copy and paste to search the page. Let's make this more convenient for readers by linking it directly to the section. Since git-log pulls in diff-generate-patch.txt, we can provide a direct link to the section. Otherwise, change the verbiage to match exactly what the section title is, to at least make searching for it an easier task. Signed-off-by: John Cai Signed-off-by: Junio C Hamano --- Documentation/diff-generate-patch.txt | 1 + Documentation/diff-options.txt | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Documentation/diff-generate-patch.txt b/Documentation/diff-generate-patch.txt index c78063d4f7..546adf79e5 100644 --- a/Documentation/diff-generate-patch.txt +++ b/Documentation/diff-generate-patch.txt @@ -1,3 +1,4 @@ +[[generate_patch_text_with_p]] Generating patch text with -p ----------------------------- diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 3674ac48e9..7d73e976d9 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 titled +ifdef::git-log[] +<>). +endif::git-log[] +ifndef::git-log[] +"Generating patch text with -p"). +endif::git-log[] ifdef::git-diff[] This is the default. endif::git-diff[]