git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kristofferhaugsbakk@fastmail.com
To: git@vger.kernel.org
Cc: Kristoffer Haugsbakk <code@khaugsbakk.name>,
	Jeff King <peff@peff.net>, Teng Long <dyroneteng@gmail.com>,
	"D . Ben Knoble" <ben.knoble@gmail.com>
Subject: [PATCH v2 4/9] doc: notes: rework --[no-]stripspace
Date: Fri, 23 May 2025 21:29:50 +0200	[thread overview]
Message-ID: <c68a91f81ba180acb1025b229dee3d1e61691e75.1748028010.git.code@khaugsbakk.name> (raw)
In-Reply-To: <cover.1748028010.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 gone

 Documentation/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


  parent reply	other threads:[~2025-05-23 19:32 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-20 17:57 [PATCH 0/6] doc: --stdin on notes and core.commentChar mentions kristofferhaugsbakk
2025-05-20 17:57 ` [PATCH 1/6] doc: stripspace: mention where the default comes from kristofferhaugsbakk
2025-05-20 19:06   ` Junio C Hamano
2025-05-21 15:04     ` Kristoffer Haugsbakk
2025-05-20 17:57 ` [PATCH 2/6] doc: config: mention core.commentChar on commit.cleanup kristofferhaugsbakk
2025-05-20 17:57 ` [PATCH 3/6] doc: notes: split out options with negations kristofferhaugsbakk
2025-05-20 19:11   ` Junio C Hamano
2025-05-21 13:14     ` Junio C Hamano
2025-05-21 14:42       ` Kristoffer Haugsbakk
2025-05-21 15:47         ` Junio C Hamano
2025-05-21 15:52           ` Kristoffer Haugsbakk
2025-05-20 17:57 ` [PATCH 4/6] doc: notes: mention comment character configuration kristofferhaugsbakk
2025-05-20 19:14   ` Junio C Hamano
2025-05-20 17:57 ` [PATCH 5/6] doc: notes: point out copy --stdin use with argv kristofferhaugsbakk
2025-05-20 19:15   ` Junio C Hamano
2025-05-20 17:57 ` [PATCH 6/6] doc: notes: treat --stdin equally between copy/remove kristofferhaugsbakk
2025-05-20 19:19   ` Junio C Hamano
2025-05-21 14:49     ` Kristoffer Haugsbakk
2025-05-21 13:19   ` D. Ben Knoble
2025-05-21 14:44     ` Kristoffer Haugsbakk
2025-05-21 15:50       ` Junio C Hamano
2025-05-23 19:29 ` [PATCH v2 0/9] doc: --stdin on notes and core.commentChar mentions kristofferhaugsbakk
2025-05-23 19:29   ` [PATCH v2 1/9] doc: stripspace: mention where the default comes from kristofferhaugsbakk
2025-05-23 19:29   ` [PATCH v2 2/9] doc: config: mention core.commentChar on commit.cleanup kristofferhaugsbakk
2025-05-23 19:29   ` [PATCH v2 3/9] doc: notes: split out options with negated forms kristofferhaugsbakk
2025-05-23 19:29   ` kristofferhaugsbakk [this message]
2025-05-23 19:29   ` [PATCH v2 5/9] doc: notes: remove stripspace discussion from other options kristofferhaugsbakk
2025-05-23 19:29   ` [PATCH v2 6/9] doc: notes: clearly state that --stripspace is the default kristofferhaugsbakk
2025-05-23 21:36     ` Junio C Hamano
2025-05-23 19:29   ` [PATCH v2 7/9] doc: notes: point out copy --stdin use with argv kristofferhaugsbakk
2025-05-23 19:29   ` [PATCH v2 8/9] doc: notes: treat --stdin equally between copy/remove kristofferhaugsbakk
2025-05-23 21:40     ` Junio C Hamano
2025-05-23 19:29   ` [PATCH v2 9/9] doc: notes: use stuck form throughout kristofferhaugsbakk
2025-05-27 21:19   ` [PATCH v3 0/9] doc: --stdin on notes and core.commentChar mentions kristofferhaugsbakk
2025-05-27 21:19     ` [PATCH v3 1/9] doc: stripspace: mention where the default comes from kristofferhaugsbakk
2025-05-27 21:19     ` [PATCH v3 2/9] doc: config: mention core.commentChar on commit.cleanup kristofferhaugsbakk
2025-05-27 21:19     ` [PATCH v3 3/9] doc: notes: split out options with negated forms kristofferhaugsbakk
2025-05-27 21:19     ` [PATCH v3 4/9] doc: notes: rework --[no-]stripspace kristofferhaugsbakk
2025-05-27 21:19     ` [PATCH v3 5/9] doc: notes: remove stripspace discussion from other options kristofferhaugsbakk
2025-05-27 21:19     ` [PATCH v3 6/9] doc: notes: clearly state that --stripspace is the default kristofferhaugsbakk
2025-05-27 21:19     ` [PATCH v3 7/9] doc: notes: point out copy --stdin use with argv kristofferhaugsbakk
2025-05-27 21:19     ` [PATCH v3 8/9] doc: notes: treat --stdin equally between copy/remove kristofferhaugsbakk
2025-05-27 21:19     ` [PATCH v3 9/9] doc: notes: use stuck form throughout kristofferhaugsbakk
2025-05-27 22:33     ` [PATCH v3 0/9] doc: --stdin on notes and core.commentChar mentions Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c68a91f81ba180acb1025b229dee3d1e61691e75.1748028010.git.code@khaugsbakk.name \
    --to=kristofferhaugsbakk@fastmail.com \
    --cc=ben.knoble@gmail.com \
    --cc=code@khaugsbakk.name \
    --cc=dyroneteng@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).