Skip to content

Commit 1a140c8

Browse files
committed
Merge branch 'kh/notes-doc-fixes'
"git notes --help" documentation updates. * kh/notes-doc-fixes: doc: notes: use stuck form throughout doc: notes: treat --stdin equally between copy/remove doc: notes: point out copy --stdin use with argv doc: notes: clearly state that --stripspace is the default doc: notes: remove stripspace discussion from other options doc: notes: rework --[no-]stripspace doc: notes: split out options with negated forms doc: config: mention core.commentChar on commit.cleanup doc: stripspace: mention where the default comes from
2 parents 5d2812f + 806337c commit 1a140c8

File tree

3 files changed

+38
-26
lines changed

3 files changed

+38
-26
lines changed

Documentation/config/commit.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ endif::git-commit[]
88
This setting overrides the default of the `--cleanup` option in
99
`git commit`. {see-git-commit} Changing the default can be useful
1010
when you always want to keep lines that begin
11-
with the comment character `#` in your log message, in which case you
11+
with the comment character (`core.commentChar`, default `#`)
12+
in your log message, in which case you
1213
would do `git config commit.cleanup whitespace` (note that you will
13-
have to remove the help lines that begin with `#` in the commit log
14-
template yourself, if you do this).
14+
have to remove the help lines that begin with the comment character
15+
in the commit log template yourself, if you do this).
1516

1617
`commit.gpgSign`::
1718
A boolean to specify whether all commits should be GPG signed.

Documentation/git-notes.adoc

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ In `--stdin` mode, take lines in the format
8787
on standard input, and copy the notes from each _<from-object>_ to its
8888
corresponding _<to-object>_. (The optional _<rest>_ is ignored so that
8989
the command can read the input given to the `post-rewrite` hook.)
90+
+
91+
`--stdin` cannot be combined with object names given on the command
92+
line.
9093

9194
`append`::
9295
Append new message(s) given by `-m` or `-F` options to an
@@ -124,6 +127,10 @@ When done, the user can either finalize the merge with
124127
giving zero or one object from the command line, this is
125128
equivalent to specifying an empty note message to
126129
the `edit` subcommand.
130+
+
131+
In `--stdin` mode, also remove the object names given on standard
132+
input. In other words, `--stdin` can be combined with object names from
133+
the command line.
127134

128135
`prune`::
129136
Remove all notes for non-existing/unreachable objects.
@@ -144,26 +151,18 @@ OPTIONS
144151
Use the given note message (instead of prompting).
145152
If multiple `-m` options are given, their values
146153
are concatenated as separate paragraphs.
147-
Lines starting with `#` and empty lines other than a
148-
single line between paragraphs will be stripped out.
149-
If you wish to keep them verbatim, use `--no-stripspace`.
150154

151155
`-F <file>`::
152156
`--file=<file>`::
153157
Take the note message from the given file. Use `-` to
154158
read the note message from the standard input.
155-
Lines starting with `#` and empty lines other than a
156-
single line between paragraphs will be stripped out.
157-
If you wish to keep them verbatim, use `--no-stripspace`.
158159

159160
`-C <object>`::
160161
`--reuse-message=<object>`::
161162
Take the given blob object (for example, another note) as the
162163
note message. (Use `git notes copy <object>` instead to
163-
copy notes between objects.). By default, message will be
164-
copied verbatim, but if you wish to strip out the lines
165-
starting with `#` and empty lines other than a single line
166-
between paragraphs, use with `--stripspace` option.
164+
copy notes between objects.) Implies `--no-stripspace` since
165+
the default behavior is to copy the message verbatim.
167166

168167
`-c <object>`::
169168
`--reedit-message=<object>`::
@@ -174,21 +173,34 @@ OPTIONS
174173
Allow an empty note object to be stored. The default behavior is
175174
to automatically remove empty notes.
176175

177-
`--[no-]separator`::
178176
`--separator=<paragraph-break>`::
177+
`--separator`::
178+
`--no-separator`::
179179
Specify a string used as a custom inter-paragraph separator
180180
(a newline is added at the end as needed). If `--no-separator`, no
181181
separators will be added between paragraphs. Defaults to a blank
182182
line.
183183

184-
`--[no-]stripspace`::
185-
Strip leading and trailing whitespace from the note message.
186-
Also strip out empty lines other than a single line between
187-
paragraphs. Lines starting with `#` will be stripped out
188-
in non-editor cases like `-m`, `-F` and `-C`, but not in
189-
editor case like `git notes edit`, `-c`, etc.
190-
191-
`--ref <ref>`::
184+
`--stripspace`::
185+
`--no-stripspace`::
186+
Clean up whitespace. Specifically (see
187+
linkgit:git-stripspace[1]):
188+
+
189+
--
190+
- remove trailing whitespace from all lines
191+
- collapse multiple consecutive empty lines into one empty line
192+
- remove empty lines from the beginning and end of the input
193+
- add a missing `\n` to the last line if necessary.
194+
--
195+
+
196+
`--stripspace` is the default except for
197+
`-C`/`--reuse-message`. However, keep in mind that this depends on the
198+
order of similar options. For example, for `-C <object> -m<message>`,
199+
`--stripspace` will be used because the default for `-m` overrides the
200+
previous `-C`. This is a known limitation that may be fixed in the
201+
future.
202+
203+
`--ref=<ref>`::
192204
Manipulate the notes tree in _<ref>_. This overrides
193205
`GIT_NOTES_REF` and the `core.notesRef` configuration. The ref
194206
specifies the full refname when it begins with `refs/notes/`; when it
@@ -200,9 +212,7 @@ OPTIONS
200212
object that does not have notes attached to it.
201213

202214
`--stdin`::
203-
Also read the object names to remove notes from the standard
204-
input (there is no reason you cannot combine this with object
205-
names from the command line).
215+
Only valid for `remove` and `copy`. See the respective subcommands.
206216

207217
`-n`::
208218
`--dry-run`::

Documentation/git-stripspace.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ OPTIONS
3737
-------
3838
-s::
3939
--strip-comments::
40-
Skip and remove all lines starting with a comment character (default '#').
40+
Skip and remove all lines starting with a comment character
41+
(`core.commentChar`, default `#`).
4142

4243
-c::
4344
--comment-lines::

0 commit comments

Comments
 (0)