Skip to contentSkip to conversation

doc: point to diff attribute in patch format docs

PATCH Superseded Peter Oliver via GitGitGadget 3 participants 4 messages Apr 26, 2021 – Apr 27, 2021 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc: point to diff attribute in patch format docs

From: Peter Oliver <[email protected]>

From the documentation for generating patch text with diff-related commands, refer to the documentation for the diff attribute.

This attribute influences the way that patches are generated, but this was previously not mentioned in e.g., the git-diff manpage.

---
doc: point to diff attribute in patch format docs

From the documentation for generating patch text with diff-related commands, refer to the documentation for the diff attribute.

This attribute influences the way that patches are generated, but this was previously not mentioned in e.g., the git-diff manpage.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-940%2Fmavit%2Fdiff-gitattributes-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-940/mavit/diff-gitattributes-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/940

 Documentation/diff-generate-patch.txt | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Documentation/diff-generate-patch.txt +5 -1
index 2db8eacc3ec7..ec506155fc74 100644
@@ -11,7 +11,7 @@ linkgit:git-diff-files[1]
 with the `-p` option produces patch text.
 You can customize the creation of patch text via the
 `GIT_EXTERNAL_DIFF` and the `GIT_DIFF_OPTS` environment variables
-(see linkgit:git[1]).
+(see linkgit:git[1]), and the `diff` attribute (see linkgit:gitattributes[5]).
 
 What the -p option produces is slightly different from the traditional
 diff format:
@@ -74,6 +74,10 @@ separate lines indicate the old and the new mode.
       rename from b
       rename to a
 
+5.  Hunk headers mention the name of the function to which the hunk
+    applies.  See linkgit:gitattributes[5] for details of how to tailor
+    to this to specific languages.
+
 
 Combined diff format
 --------------------

base-commit: 48bf2fa8bad054d66bd79c6ba903c89c704201f7

Signature · 1 line
gitgitgadget
#1 lore raw
Quoted 10 lines · Peter Oliver via GitGitGadget
Documentation/diff-generate-patch.txt +1 -1
@@ -11,7 +11,7 @@ linkgit:git-diff-files[1]
 with the `-p` option produces patch text.
 You can customize the creation of patch text via the
 `GIT_EXTERNAL_DIFF` and the `GIT_DIFF_OPTS` environment variables
-(see linkgit:git[1]).
+(see linkgit:git[1]), and the `diff` attribute (see linkgit:gitattributes[5]).
 
 What the -p option produces is slightly different from the traditional
 diff format:

Documentation/diff-generate-patch.txt separate lines indicate the old and the new mode. · line 79

Quoted 6 lines
Documentation/diff-generate-patch.txt +3 -0
@@ -74,6 +74,10 @@ separate lines indicate the old and the new mode.
       rename from b
       rename to a
 
+5.  Hunk headers mention the name of the function to which the hunk
+    applies.  See linkgit:gitattributes[5] for details of how to tailor
+    to this to specific languages.

Shouldn't this part be as helpful as the change you made to the earlier part by mentioning that the user wants to look at a specific part of the document, instead of reading the entire gitattributes(5) manpage? Perhaps "Defining a custom hunk header" section is what they want to refer to.

Quoted 4 lines
Documentation/diff-generate-patch.txt +0 -0
 Combined diff format
 --------------------
 

base-commit: 48bf2fa8bad054d66bd79c6ba903c89c704201f7

#2 lore raw
Quoted 11 lines · Junio C Hamano

Documentation/diff-generate-patch.txt separate lines indicate the old and the new mode. · line 79

Quoted 3 lines · Peter Oliver via GitGitGadget

+5. Hunk headers mention the name of the function to which the hunk

Documentation/diff-generate-patch.txt +2 -0
+    applies.  See linkgit:gitattributes[5] for details of how to tailor
+    to this to specific languages.

Shouldn't this part be as helpful as the change you made to the earlier part by mentioning that the user wants to look at a specific part of the document, instead of reading the entire gitattributes(5) manpage? Perhaps "Defining a custom hunk header" section is what they want to refer to.

Thanks, good suggestion.

Signature · 1 line
Peter Oliver
#3 lore raw

PATCH v2 1/1 doc: point to diff attribute in patch format docs

In reply to Peter Oliver via GitGitGadget

From: Peter Oliver <[email protected]>

From the documentation for generating patch text with diff-related commands, refer to the documentation for the diff attribute.

This attribute influences the way that patches are generated, but this was previously not mentioned in e.g., the git-diff manpage.

---
doc: point to diff attribute in patch format docs

From the documentation for generating patch text with diff-related commands, refer to the documentation for the diff attribute.

This attribute influences the way that patches are generated, but this was previously not mentioned in e.g., the git-diff manpage.

v2: Mention the specific relevant section of the gitattributes manual. Thanks to Junio C Hamano for the suggestion.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-940%2Fmavit%2Fdiff-gitattributes-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-940/mavit/diff-gitattributes-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/940

Range-diff vs v1:

1: 6f87f3962b84 ! 1: 191d81ef61a5 doc: point to diff attribute in patch format docs
@@ Documentation/diff-generate-patch.txt: separate lines indicate the old and the n
rename to a

+5. Hunk headers mention the name of the function to which the hunk
-+ applies. See linkgit:gitattributes[5] for details of how to tailor
-+ to this to specific languages.
++ applies. See "Defining a custom hunk-header" in
++ linkgit:gitattributes[5] for details of how to tailor to this to
++ specific languages.
+

Combined diff format

 Documentation/diff-generate-patch.txt | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/diff-generate-patch.txt +6 -1
index 2db8eacc3ec7..c78063d4f74a 100644
@@ -11,7 +11,7 @@ linkgit:git-diff-files[1]
 with the `-p` option produces patch text.
 You can customize the creation of patch text via the
 `GIT_EXTERNAL_DIFF` and the `GIT_DIFF_OPTS` environment variables
-(see linkgit:git[1]).
+(see linkgit:git[1]), and the `diff` attribute (see linkgit:gitattributes[5]).
 
 What the -p option produces is slightly different from the traditional
 diff format:
@@ -74,6 +74,11 @@ separate lines indicate the old and the new mode.
       rename from b
       rename to a
 
+5.  Hunk headers mention the name of the function to which the hunk
+    applies.  See "Defining a custom hunk-header" in
+    linkgit:gitattributes[5] for details of how to tailor to this to
+    specific languages.
+
 
 Combined diff format
 --------------------

base-commit: 311531c9de557d25ac087c1637818bd2aad6eb3a

Signature · 1 line
gitgitgadget