Skip to content

note

Add a note for an object

The notesRef argument is the canonical name of the reference to use, defaulting to "refs/notes/commits". If force is specified then previous notes are overwritten.

Signature

ts
class Repository {
  note(oid: string, note: string, options?: CreateNoteOptions | null | undefined): string;
}

Parameters

  • oidrequired · string

    OID of the git object to decorate.

  • noterequired · string

    Content of the note to add for object oid.

  • optionsnull | CreateNoteOptions

    Options for creating note.

    • authorSignaturePayload

      Signature of the notes commit author. If not provided, the default signature of the repository will be used. If there is no default signature set for the repository, an error will occur.

      • emailrequired · string

        Email on the signature.

      • namerequired · string

        Name on the signature.

      • timeOptionsSignatureTimeOptions
        • offsetnumber

          Timezone offset, in minutes

        • timestamprequired · number

          Time in seconds, from epoch

    • committerSignaturePayload

      Signature of the notes commit commiter. If not provided, the default signature of the repository will be used. If there is no default signature set for the repository, an error will occur.

      • emailrequired · string

        Email on the signature.

      • namerequired · string

        Name on the signature.

      • timeOptionsSignatureTimeOptions
        • offsetnumber

          Timezone offset, in minutes

        • timestamprequired · number

          Time in seconds, from epoch

    • forceboolean

      Overwrite existing note.

    • notesRefstring

      canonical name of the reference to use. Defaults to "refs/notes/commits".

Returns

  • string

    OID for the note.

Released under the MIT License.