Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1 | git-notes(1) |
| 2 | ============ |
| 3 | |
| 4 | NAME |
| 5 | ---- |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 6 | git-notes - Add/inspect object notes |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 7 | |
| 8 | SYNOPSIS |
| 9 | -------- |
| 10 | [verse] |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 11 | 'git notes' [list [<object>]] |
| 12 | 'git notes' add [-f] [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame^] | 13 | 'git notes' copy [-f] ( --stdin | <from-object> <to-object> ) |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 14 | 'git notes' append [-F <file> | -m <msg> | (-c | -C) <object>] [<object>] |
| 15 | 'git notes' edit [<object>] |
| 16 | 'git notes' show [<object>] |
| 17 | 'git notes' remove [<object>] |
| 18 | 'git notes' prune |
| 19 | |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 20 | |
| 21 | DESCRIPTION |
| 22 | ----------- |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 23 | This command allows you to add/remove notes to/from objects, without |
| 24 | changing the objects themselves. |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 25 | |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 26 | A typical use of notes is to extend a commit message without having |
| 27 | to change the commit itself. Such commit notes can be shown by `git log` |
| 28 | along with the original commit message. To discern these notes from the |
| 29 | message stored in the commit object, the notes are indented like the |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame^] | 30 | message, after an unindented line saying "Notes (<refname>):" (or |
| 31 | "Notes:" for the default setting). |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 32 | |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame^] | 33 | This command always manipulates the notes specified in "core.notesRef" |
| 34 | (see linkgit:git-config[1]), which can be overridden by GIT_NOTES_REF. |
| 35 | To change which notes are shown by 'git-log', see the |
| 36 | "notes.displayRef" configuration. |
| 37 | |
| 38 | See the description of "notes.rewrite.<command>" in |
| 39 | linkgit:git-config[1] for a way of carrying your notes across commands |
| 40 | that rewrite commits. |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 41 | |
| 42 | |
| 43 | SUBCOMMANDS |
| 44 | ----------- |
| 45 | |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 46 | list:: |
| 47 | List the notes object for a given object. If no object is |
| 48 | given, show a list of all note objects and the objects they |
| 49 | annotate (in the format "<note object> <annotated object>"). |
| 50 | This is the default subcommand if no subcommand is given. |
| 51 | |
| 52 | add:: |
| 53 | Add notes for a given object (defaults to HEAD). Abort if the |
| 54 | object already has notes (use `-f` to overwrite an |
| 55 | existing note). |
| 56 | |
| 57 | copy:: |
| 58 | Copy the notes for the first object onto the second object. |
| 59 | Abort if the second object already has notes, or if the first |
| 60 | object has none (use -f to overwrite existing notes to the |
| 61 | second object). This subcommand is equivalent to: |
| 62 | `git notes add [-f] -C $(git notes list <from-object>) <to-object>` |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame^] | 63 | + |
| 64 | In `\--stdin` mode, take lines in the format |
| 65 | + |
| 66 | ---------- |
| 67 | <from-object> SP <to-object> [ SP <rest> ] LF |
| 68 | ---------- |
| 69 | + |
| 70 | on standard input, and copy the notes from each <from-object> to its |
| 71 | corresponding <to-object>. (The optional `<rest>` is ignored so that |
| 72 | the command can read the input given to the `post-rewrite` hook.) |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 73 | |
| 74 | append:: |
| 75 | Append to the notes of an existing object (defaults to HEAD). |
| 76 | Creates a new notes object if needed. |
| 77 | |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 78 | edit:: |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 79 | Edit the notes for a given object (defaults to HEAD). |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 80 | |
| 81 | show:: |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 82 | Show the notes for a given object (defaults to HEAD). |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 83 | |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 84 | remove:: |
| 85 | Remove the notes for a given object (defaults to HEAD). |
| 86 | This is equivalent to specifying an empty note message to |
| 87 | the `edit` subcommand. |
| 88 | |
| 89 | prune:: |
| 90 | Remove all notes for non-existing/unreachable objects. |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 91 | |
| 92 | OPTIONS |
| 93 | ------- |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 94 | -f:: |
| 95 | --force:: |
| 96 | When adding notes to an object that already has notes, |
| 97 | overwrite the existing notes (instead of aborting). |
| 98 | |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 99 | -m <msg>:: |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 100 | --message=<msg>:: |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 101 | Use the given note message (instead of prompting). |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 102 | If multiple `-m` options are given, their values |
| 103 | are concatenated as separate paragraphs. |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 104 | |
| 105 | -F <file>:: |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 106 | --file=<file>:: |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 107 | Take the note message from the given file. Use '-' to |
| 108 | read the note message from the standard input. |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 109 | |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 110 | -C <object>:: |
| 111 | --reuse-message=<object>:: |
| 112 | Reuse the note message from the given note object. |
| 113 | |
| 114 | -c <object>:: |
| 115 | --reedit-message=<object>:: |
| 116 | Like '-C', but with '-c' the editor is invoked, so that |
| 117 | the user can further edit the note message. |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 118 | |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame^] | 119 | --ref <ref>:: |
| 120 | Manipulate the notes tree in <ref>. This overrides both |
| 121 | GIT_NOTES_REF and the "core.notesRef" configuration. The ref |
| 122 | is taken to be in `refs/notes/` if it is not qualified. |
| 123 | |
| 124 | |
| 125 | NOTES |
| 126 | ----- |
| 127 | |
| 128 | Every notes change creates a new commit at the specified notes ref. |
| 129 | You can therefore inspect the history of the notes by invoking, e.g., |
| 130 | `git log -p notes/commits`. |
| 131 | |
| 132 | Currently the commit message only records which operation triggered |
| 133 | the update, and the commit authorship is determined according to the |
| 134 | usual rules (see linkgit:git-commit[1]). These details may change in |
| 135 | the future. |
| 136 | |
| 137 | |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 138 | Author |
| 139 | ------ |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 140 | Written by Johannes Schindelin <johannes.schindelin@gmx.de> and |
| 141 | Johan Herland <johan@herland.net> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 142 | |
| 143 | Documentation |
| 144 | ------------- |
Junio C Hamano | ea90ab3 | 2010-03-15 20:32:55 | [diff] [blame] | 145 | Documentation by Johannes Schindelin and Johan Herland |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 146 | |
| 147 | GIT |
| 148 | --- |
| 149 | Part of the linkgit:git[7] suite |