notes

package
v2.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package notes git-notes - Add or inspect object notes.

SYNOPSIS

Reference: https://git-scm.com/docs/git-notes

git notes [list [<object>]]
git notes add [-f] [--allow-empty] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>]
git notes copy [-f] ( --stdin | <from-object> [<to-object>] )
git notes append [--allow-empty] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>]
git notes edit [--allow-empty] [<object>]
git notes show [<object>]
git notes merge [-v | -q] [-s <strategy> ] <notes-ref>
git notes merge --commit [-v | -q]
git notes merge --abort [-v | -q]
git notes remove [--ignore-missing] [--stdin] [<object>…​]
git notes prune [-n] [-v]
git notes get-ref

DESCRIPTION

Adds, removes, or reads notes attached to objects, without touching the objects themselves.

By default, notes are saved to and read from refs/notes/commits, but this default can be overridden. See the OPTIONS, CONFIGURATION, and ENVIRONMENT sections below. If this ref does not exist, it will be quietly created when it is first needed to store a note.

A typical use of notes is to supplement a commit message without changing the commit itself. Notes can be shown by git log along with the original commit message. To distinguish these notes from the message stored in the commit object, the notes are indented like the message, after an unindented line saying "Notes (<refname>):" (or "Notes:" for refs/notes/commits).

Notes can also be added to patches prepared with git format-patch by using the --notes option. Such notes are added as a patch commentary after a three dash separator line.

To change which notes are shown by git log, see the "notes.displayRef" configuration in git-log[1].

See the "notes.rewrite.<command>" configuration for a way to carry notes across commands that rewrite commits.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abort

func Abort(g *types.Cmd)

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. --abort

func Add

func Add(object string, opts ...types.Option) types.Option

Add notes for a given object (defaults to `HEAD`). usage: git notes add [<options>] [<object>]

-m, --message <message>
                      note contents as a string
-F, --file <file>     note contents in a file
-c, --reedit-message <object>
                      reuse and edit specified note object
-C, --reuse-message <object>
                      reuse specified note object
--allow-empty         allow storing empty note
-f, --force           replace existing notes

func AllowEmpty

func AllowEmpty(g *types.Cmd)

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

func Append

func Append(object string, opts ...types.Option) types.Option

Append to the notes of an existing object (defaults to `HEAD`). Creates a new notes object if needed. usage: git notes append [<options>] [<object>]

-m, --message <message>
                      note contents as a string
-F, --file <file>     note contents in a file
-c, --reedit-message <object>
                      reuse and edit specified note object
-C, --reuse-message <object>
                      reuse specified note object
--allow-empty         allow storing empty note

func Commit

func Commit(g *types.Cmd)

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. --commit

func Copy

func Copy(opts ...types.Option) types.Option

Copy the notes for the first object onto the second object (defaults to `HEAD`). usage: git notes copy [<options>] <from-object> <to-object>

or: git notes copy --stdin [<from-object> <to-object>]...

 -f, --force           replace existing notes
 --stdin               read objects from stdin
 --for-rewrite <command>
                       load rewriting config for <command> (implies --stdin)

func DryRun

func DryRun(g *types.Cmd)

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

func Edit

func Edit(object string, opts ...types.Option) types.Option

Edit the notes for a given object (defaults to `HEAD`). usage: git notes edit [<object>]

-m, --message <message>
                      note contents as a string
-F, --file <file>     note contents in a file
-c, --reedit-message <object>
                      reuse and edit specified note object
-C, --reuse-message <object>
                      reuse specified note object
--allow-empty         allow storing empty note

func File

func File(value string) func(*types.Cmd)

File Take the note message from the given file. Use - to read the note message from the standard input. Lines starting with # and empty lines other than a single line between paragraphs will be stripped out. -F <file>, --file=<file>

func Force

func Force(g *types.Cmd)

Force When adding notes to an object that already has notes, overwrite the existing notes (instead of aborting). -f, --force

func GetRef

func GetRef(_ ...types.Option) types.Option

GetRef Print the current notes ref. This provides an easy way to retrieve the current notes ref (e.g. from scripts). usage: git notes get-ref

func IgnoreMissing

func IgnoreMissing(g *types.Cmd)

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

func List

func List(object string) types.Option

List the notes object for a given object. usage: git notes [list [<object>]]

func Merge

func Merge(opts ...types.Option) types.Option

Merge the given notes ref into the current notes ref. usage: git notes merge [<options>] <notes-ref>

or: git notes merge --commit [<options>]
or: git notes merge --abort [<options>]

General options

-v, --verbose         be more verbose
-q, --quiet           be more quiet

Merge options

-s, --strategy <strategy>
                      resolve notes conflicts using the given strategy (manual/ours/theirs/union/cat_sort_uniq)

Committing unmerged notes

--commit              finalize notes merge by committing unmerged notes

Aborting notes merge resolution

--abort               abort notes merge

func Message

func Message(msg string) func(*types.Cmd)

Message Use the given note message (instead of prompting). If multiple -m options are given, their values are concatenated as separate paragraphs. Lines starting with # and empty lines other than a single line between paragraphs will be stripped out. -m <msg>, --message=<msg>

func NotesRef

func NotesRef(ref string) func(*types.Cmd)

NotesRef related to `merge` sub-command (`<notes-ref>`).

func Object

func Object(from, to string) func(*types.Cmd)

Object related to `copy` sub-command (`<from-object> <to-object>`).

func Prune

func Prune(opts ...types.Option) types.Option

Prune Remove all notes for non-existing/unreachable objects. usage: git notes prune [<options>]

-n, --dry-run         do not remove, show only
-v, --verbose         report pruned notes

func Quiet

func Quiet(g *types.Cmd)

Quiet When merging notes, operate quietly. -q, --quiet

func ReeditMessage

func ReeditMessage(object string) func(*types.Cmd)

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

func Ref

func Ref(value string) func(*types.Cmd)

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. --ref <ref>

func Remove

func Remove(object string, opts ...types.Option) types.Option

Remove the notes for given objects (defaults to `HEAD`). usage: git notes remove [<object>]

--ignore-missing      attempt to remove non-existent note is not an error
--stdin               read object names from the standard input

func ReuseMessage

func ReuseMessage(object string) func(*types.Cmd)

ReuseMessage Take the given blob object (for example, another note) as the note message. (Use git notes copy <object> instead to copy notes between objects.) -C <object>, --reuse-message=<object>

func Show

func Show(object string) types.Option

Show the notes for a given object (defaults to `HEAD`). usage: git notes show [<object>]

func Stdin

func Stdin(g *types.Cmd)

Stdin Also read the object names to remove notes from the standard input (there is no reason you cannot combine this with object names from the command line). --stdin

func Strategy

func Strategy(value string) func(*types.Cmd)

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. -s <strategy>, --strategy=<strategy>

func Verbose

func Verbose(g *types.Cmd)

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

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL