[PATCH v3 4/9] doc: notes: rework --[no-]stripspace
- From
- kristofferhaugsbakk@fastmail.com <kristofferhaugsbakk@fastmail.com>
- Date
- May 27, 2025, 21:19 UTC
- Message-ID
- <c68a91f81ba180acb1025b229dee3d1e61691e75.1748380390.git.code@khaugsbakk.name>
- In-Reply-To
- <cover.1748380390.git.code@khaugsbakk.name>
From: Kristoffer Haugsbakk <code@khaugsbakk.name>
Document this option by copying the bullet list from git-stripspace(1). A bullet list is cleaner when there are this many points to consider. We also get a more standardized description of the multiple-blank-lines behavior. Compare the repeating (git-notes(1)):
empty lines other than a single line between paragraphs
With (git-stripspace(1)):
multiple consecutive empty lines
And:
leading [...] whitespace
With:
empty lines from the beginning
Leading whitespace in the form of spaces (indentation) are not removed. However, empty lines at the start of the message are removed.
Note that we drop the mentions of comment line handling because they are wrong; this option does not control how lines which can be recognized as comment lines are handled. Only interactivity controls that:
• Comment lines are stripped after editing interactively • Lines which could be recognized as comment lines are left alone when the message is given non-interactively
So it is misleading to document the comment line behavior on this option.
Further, the text is wrong:
Lines starting with `#` will be stripped out in non-editor cases
like `-m`, [...]Comment lines are still indirectly discussed on other options. We will deal with them in the next commit.
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> ---
Notes (series):
v2:
• New
• Together with one other other patch replaces v1 patch “doc: notes:
mention comment character configuration”
• I figured out that mentioning the comment character/comment lines
doesn’t make sense here. So all attempts to rephrase “comment
character” or “lines that start with `#`” are goneDocumentation/git-notes.adoc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/Documentation/git-notes.adoc b/Documentation/git-notes.adoc index 8706b33f2ee..d672794a942 100644 --- a/Documentation/git-notes.adoc +++ b/Documentation/git-notes.adoc @@ -184,11 +184,13 @@ OPTIONS `--stripspace`:: `--no-stripspace`:: - Strip leading and trailing whitespace from the note message. - Also strip out empty lines other than a single line between - paragraphs. Lines starting with `#` will be stripped out - in non-editor cases like `-m`, `-F` and `-C`, but not in - editor case like `git notes edit`, `-c`, etc. + Clean up whitespace. Specifically (see + linkgit:git-stripspace[1]): ++ +- remove trailing whitespace from all lines +- collapse multiple consecutive empty lines into one empty line +- remove empty lines from the beginning and end of the input +- add a missing `\n` to the last line if necessary. `--ref <ref>`:: Manipulate the notes tree in _<ref>_. This overrides
-- 2.49.0.780.g892193c3f50