Skip to content

Commit 5bd277e

Browse files
avargitster
authored andcommitted
notes docs: de-duplicate and combine configuration sections
Combine the various "notes" configuration sections spread across Documentation/config/notes.txt and Documentation/git-notes.txt to live in the former, and to be included in the latter. We'll now forward link from "git notes" to the "CONFIGURATION" section below, rather than to "git-config(1)" when discussing configuration variables that are (also) discussed in that section. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Reviewed-by: Matheus Tavares <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 416fed2 commit 5bd277e

File tree

3 files changed

+33
-81
lines changed

3 files changed

+33
-81
lines changed

Documentation/config/notes.txt

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ notes.mergeStrategy::
33
conflicts. Must be one of `manual`, `ours`, `theirs`, `union`, or
44
`cat_sort_uniq`. Defaults to `manual`. See "NOTES MERGE STRATEGIES"
55
section of linkgit:git-notes[1] for more information on each strategy.
6+
+
7+
This setting can be overridden by passing the `--strategy` option to
8+
linkgit:git-notes[1].
69

710
notes.<name>.mergeStrategy::
811
Which merge strategy to choose when doing a notes merge into
@@ -11,28 +14,35 @@ notes.<name>.mergeStrategy::
1114
linkgit:git-notes[1] for more information on the available strategies.
1215

1316
notes.displayRef::
14-
The (fully qualified) refname from which to show notes when
15-
showing commit messages. The value of this variable can be set
16-
to a glob, in which case notes from all matching refs will be
17-
shown. You may also specify this configuration variable
18-
several times. A warning will be issued for refs that do not
19-
exist, but a glob that does not match any refs is silently
20-
ignored.
17+
Which ref (or refs, if a glob or specified more than once), in
18+
addition to the default set by `core.notesRef` or
19+
`GIT_NOTES_REF`, to read notes from when showing commit
20+
messages with the 'git log' family of commands.
2121
+
2222
This setting can be overridden with the `GIT_NOTES_DISPLAY_REF`
2323
environment variable, which must be a colon separated list of refs or
2424
globs.
2525
+
26+
A warning will be issued for refs that do not exist,
27+
but a glob that does not match any refs is silently ignored.
28+
+
29+
This setting can be disabled by the `--no-notes` option to the 'git
30+
log' family of commands, or by the `--notes=<ref>` option accepted by
31+
those commands.
32+
+
2633
The effective value of "core.notesRef" (possibly overridden by
2734
GIT_NOTES_REF) is also implicitly added to the list of refs to be
2835
displayed.
2936

3037
notes.rewrite.<command>::
3138
When rewriting commits with <command> (currently `amend` or
32-
`rebase`) and this variable is set to `true`, Git
33-
automatically copies your notes from the original to the
34-
rewritten commit. Defaults to `true`, but see
35-
"notes.rewriteRef" below.
39+
`rebase`), if this variable is `false`, git will not copy
40+
notes from the original to the rewritten commit. Defaults to
41+
`true`. See also "`notes.rewriteRef`" below.
42+
+
43+
This setting can be overridden with the `GIT_NOTES_REWRITE_REF`
44+
environment variable, which must be a colon separated list of refs or
45+
globs.
3646

3747
notes.rewriteMode::
3848
When copying notes during a rewrite (see the
@@ -46,14 +56,13 @@ environment variable.
4656

4757
notes.rewriteRef::
4858
When copying notes during a rewrite, specifies the (fully
49-
qualified) ref whose notes should be copied. The ref may be a
50-
glob, in which case notes in all matching refs will be copied.
51-
You may also specify this configuration several times.
59+
qualified) ref whose notes should be copied. May be a glob,
60+
in which case notes in all matching refs will be copied. You
61+
may also specify this configuration several times.
5262
+
5363
Does not have a default value; you must configure this variable to
5464
enable note rewriting. Set it to `refs/notes/commits` to enable
5565
rewriting for the default commit notes.
5666
+
57-
This setting can be overridden with the `GIT_NOTES_REWRITE_REF`
58-
environment variable, which must be a colon separated list of refs or
59-
globs.
67+
Can be overridden with the `GIT_NOTES_REWRITE_REF` environment variable.
68+
See `notes.rewrite.<command>` above for a further description of its format.

Documentation/git-log.txt

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -227,19 +227,9 @@ log.showSignature::
227227
mailmap.*::
228228
See linkgit:git-shortlog[1].
229229

230-
notes.displayRef::
231-
Which refs, in addition to the default set by `core.notesRef`
232-
or `GIT_NOTES_REF`, to read notes from when showing commit
233-
messages with the `log` family of commands. See
234-
linkgit:git-notes[1].
235-
+
236-
May be an unabbreviated ref name or a glob and may be specified
237-
multiple times. A warning will be issued for refs that do not exist,
238-
but a glob that does not match any refs is silently ignored.
239-
+
240-
This setting can be disabled by the `--no-notes` option,
241-
overridden by the `GIT_NOTES_DISPLAY_REF` environment variable,
242-
and overridden by the `--notes=<ref>` option.
230+
include::includes/cmd-config-section-rest.txt[]
231+
232+
include::config/notes.txt[]
243233

244234
GIT
245235
---

Documentation/git-notes.txt

Lines changed: 4 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ using the `--notes` option. Such notes are added as a patch commentary
4444
after a three dash separator line.
4545

4646
To change which notes are shown by 'git log', see the
47-
"notes.displayRef" configuration in linkgit:git-log[1].
47+
"notes.displayRef" discussion in <<CONFIGURATION>>.
4848

4949
See the "notes.rewrite.<command>" configuration for a way to carry
5050
notes across commands that rewrite commits.
@@ -307,6 +307,7 @@ with 'git log', so if you use such notes, you'll probably need to write
307307
some special-purpose tools to do something useful with them.
308308

309309

310+
[[CONFIGURATION]]
310311
CONFIGURATION
311312
-------------
312313

@@ -316,57 +317,9 @@ core.notesRef::
316317
This setting can be overridden through the environment and
317318
command line.
318319

319-
notes.mergeStrategy::
320-
Which merge strategy to choose by default when resolving notes
321-
conflicts. Must be one of `manual`, `ours`, `theirs`, `union`, or
322-
`cat_sort_uniq`. Defaults to `manual`. See "NOTES MERGE STRATEGIES"
323-
section above for more information on each strategy.
324-
+
325-
This setting can be overridden by passing the `--strategy` option.
326-
327-
notes.<name>.mergeStrategy::
328-
Which merge strategy to choose when doing a notes merge into
329-
refs/notes/<name>. This overrides the more general
330-
"notes.mergeStrategy". See the "NOTES MERGE STRATEGIES" section above
331-
for more information on each available strategy.
332-
333-
notes.displayRef::
334-
Which ref (or refs, if a glob or specified more than once), in
335-
addition to the default set by `core.notesRef` or
336-
`GIT_NOTES_REF`, to read notes from when showing commit
337-
messages with the 'git log' family of commands.
338-
This setting can be overridden on the command line or by the
339-
`GIT_NOTES_DISPLAY_REF` environment variable.
340-
See linkgit:git-log[1].
341-
342-
notes.rewrite.<command>::
343-
When rewriting commits with <command> (currently `amend` or
344-
`rebase`), if this variable is `false`, git will not copy
345-
notes from the original to the rewritten commit. Defaults to
346-
`true`. See also "`notes.rewriteRef`" below.
347-
+
348-
This setting can be overridden by the `GIT_NOTES_REWRITE_REF`
349-
environment variable.
320+
include::includes/cmd-config-section-rest.txt[]
350321

351-
notes.rewriteMode::
352-
When copying notes during a rewrite, what to do if the target
353-
commit already has a note. Must be one of `overwrite`,
354-
`concatenate`, `cat_sort_uniq`, or `ignore`. Defaults to
355-
`concatenate`.
356-
+
357-
This setting can be overridden with the `GIT_NOTES_REWRITE_MODE`
358-
environment variable.
359-
360-
notes.rewriteRef::
361-
When copying notes during a rewrite, specifies the (fully
362-
qualified) ref whose notes should be copied. May be a glob,
363-
in which case notes in all matching refs will be copied. You
364-
may also specify this configuration several times.
365-
+
366-
Does not have a default value; you must configure this variable to
367-
enable note rewriting.
368-
+
369-
Can be overridden with the `GIT_NOTES_REWRITE_REF` environment variable.
322+
include::config/notes.txt[]
370323

371324

372325
ENVIRONMENT

0 commit comments

Comments
 (0)