Home Explore Blog CI



git

3rd chunk of `Documentation/git-notes.adoc`
05bc494bd4331b9d7f8c99eec8cea6c4b9b2187a6777ed300000000100000fa0
 input.

`-C <object>`::
`--reuse-message=<object>`::
	Take the given blob object (for example, another note) as the
	note message. (Use `git notes copy <object>` instead to
	copy notes between objects.)  Implies `--no-stripspace` since
	the default behavior is to copy the message verbatim.

`-c <object>`::
`--reedit-message=<object>`::
	Like `-C`, but with `-c` the editor is invoked, so that
	the user can further edit the note message.

`--allow-empty`::
	Allow an empty note object to be stored. The default behavior is
	to automatically remove empty notes.

`--separator=<paragraph-break>`::
`--separator`::
`--no-separator`::
	Specify a string used as a custom inter-paragraph separator
	(a newline is added at the end as needed). If `--no-separator`, no
	separators will be added between paragraphs.  Defaults to a blank
	line.

`--stripspace`::
`--no-stripspace`::
	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.
--
+
`--stripspace` is the default except for
`-C`/`--reuse-message`. However, keep in mind that this depends on the
order of similar options. For example, for `-C <object> -m<message>`,
`--stripspace` will be used because the default for `-m` overrides the
previous `-C`. This is a known limitation that may be fixed in the
future.

`--ref=<ref>`::
	Manipulate the notes tree in _<ref>_.  This overrides
	`GIT_NOTES_REF` and the `core.notesRef` configuration.  The ref
	specifies the full refname when it begins with `refs/notes/`; when it
	begins with `notes/`, `refs/` and otherwise `refs/notes/` is prefixed
	to form a full name of the ref.

`--ignore-missing`::
	Do not consider it an error to request removing notes from an
	object that does not have notes attached to it.

`--stdin`::
	Only valid for `remove` and `copy`. See the respective subcommands.

`-n`::
`--dry-run`::
	Do not remove anything; just report the object names whose notes
	would be removed.

`-s <strategy>`::
`--strategy=<strategy>`::
	When merging notes, resolve notes conflicts using the given
	strategy. The following strategies are recognized: `manual`
	(default), `ours`, `theirs`, `union` and `cat_sort_uniq`.
	This option overrides the `notes.mergeStrategy` configuration setting.
	See the "NOTES MERGE STRATEGIES" section below for more
	information on each notes merge strategy.

`--commit`::
	Finalize an in-progress `git notes merge`. Use this option
	when you have resolved the conflicts that `git notes merge`
	stored in `.git/NOTES_MERGE_WORKTREE`. This amends the partial
	merge commit created by `git notes merge` (stored in
	`.git/NOTES_MERGE_PARTIAL`) by adding the notes in
	`.git/NOTES_MERGE_WORKTREE`. The notes ref stored in the
	`.git/NOTES_MERGE_REF` symref is updated to the resulting commit.

`--abort`::
	Abort/reset an in-progress `git notes merge`, i.e. a notes merge
	with conflicts. This simply removes all files related to the
	notes merge.

`-q`::
`--quiet`::
	When merging notes, operate quietly.

`-v`::
`--verbose`::
	When merging notes, be more verbose.
	When pruning notes, report all object names whose notes are
	removed.


DISCUSSION
----------

Commit notes are blobs containing extra information about an object
(usually information to supplement a commit's message).  These blobs
are taken from notes refs.  A notes ref is usually a branch which
contains "files" whose paths are the object names for the objects
they describe, with some directory separators included for performance
reasons footnote:[Permitted pathnames have the form
'bf'`/`'fe'`/`'30'`/`'...'`/`'680d5a...': a sequence of directory
names of two hexadecimal digits each followed by a filename with the
rest of the object ID.].

Every notes change creates a new commit at the specified notes ref.
You can therefore inspect the history of the

Title: Git Notes Options and Discussion
Summary
The git-notes command offers various options for managing notes, including specifying note messages, customizing separators, and cleaning up whitespace. Additional options control the manipulation of notes trees, notes merging, and conflict resolution. The discussion section explains the concept of commit notes, notes refs, and how notes changes create new commits, allowing for the inspection of notes history.