blob: 850dff9be6fc286e2492da17030a36c60ff1bfa6 [file] [log] [blame]
Junio C Hamano3b70d3c2009-11-21 17:37:371<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Junio C Hamano788eeba2010-12-08 22:50:436<meta name="generator" content="AsciiDoc 8.4.5" />
7<title>git-notes(1)</title>
Junio C Hamano3b70d3c2009-11-21 17:37:378<style type="text/css">
9/* Debug borders */
10p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
11/*
12 border: 1px solid red;
13*/
14}
15
16body {
17 margin: 1em 5% 1em 5%;
18}
19
20a {
21 color: blue;
22 text-decoration: underline;
23}
24a:visited {
25 color: fuchsia;
26}
27
28em {
29 font-style: italic;
Junio C Hamano788eeba2010-12-08 22:50:4330 color: navy;
Junio C Hamano3b70d3c2009-11-21 17:37:3731}
32
33strong {
34 font-weight: bold;
Junio C Hamano788eeba2010-12-08 22:50:4335 color: #083194;
Junio C Hamano3b70d3c2009-11-21 17:37:3736}
37
38tt {
39 color: navy;
40}
41
42h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
48}
49
50h1, h2, h3 {
51 border-bottom: 2px solid silver;
52}
53h2 {
54 padding-top: 0.5em;
55}
56h3 {
57 float: left;
58}
59h3 + * {
60 clear: left;
61}
62
63div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
66}
67
68hr {
69 border: 1px solid silver;
70}
71
72p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
75}
76
Junio C Hamano788eeba2010-12-08 22:50:4377ul, ol, li > p {
78 margin-top: 0;
79}
80
Junio C Hamano3b70d3c2009-11-21 17:37:3781pre {
82 padding: 0;
83 margin: 0;
84}
85
86span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
91}
92span#email {
93}
Junio C Hamano788eeba2010-12-08 22:50:4394span#revnumber, span#revdate, span#revremark {
Junio C Hamano3b70d3c2009-11-21 17:37:3795 font-family: sans-serif;
96}
97
98div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
104}
105div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
108}
109div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
112}
113
Junio C Hamano788eeba2010-12-08 22:50:43114div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
117}
Junio C Hamano3b70d3c2009-11-21 17:37:37118div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120div.admonitionblock {
Junio C Hamano3b70d3c2009-11-21 17:37:37121 margin-top: 1.5em;
122 margin-bottom: 1.5em;
123}
124div.admonitionblock {
125 margin-top: 2.5em;
126 margin-bottom: 2.5em;
127}
128
129div.content { /* Block element content. */
130 padding: 0;
131}
132
133/* Block element titles. */
134div.title, caption.title {
Junio C Hamano788eeba2010-12-08 22:50:43135 color: #527bbd;
Junio C Hamano3b70d3c2009-11-21 17:37:37136 font-family: sans-serif;
137 font-weight: bold;
138 text-align: left;
139 margin-top: 1.0em;
140 margin-bottom: 0.5em;
141}
142div.title + * {
143 margin-top: 0;
144}
145
146td div.title:first-child {
147 margin-top: 0.0em;
148}
149div.content div.title:first-child {
150 margin-top: 0.0em;
151}
152div.content + div.title {
153 margin-top: 0.0em;
154}
155
156div.sidebarblock > div.content {
157 background: #ffffee;
158 border: 1px solid silver;
159 padding: 0.5em;
160}
161
Junio C Hamano3b70d3c2009-11-21 17:37:37162div.listingblock > div.content {
163 border: 1px solid silver;
164 background: #f4f4f4;
165 padding: 0.5em;
166}
167
Junio C Hamano788eeba2010-12-08 22:50:43168div.quoteblock {
Junio C Hamano3b70d3c2009-11-21 17:37:37169 padding-left: 2.0em;
Junio C Hamano788eeba2010-12-08 22:50:43170 margin-right: 10%;
Junio C Hamano3b70d3c2009-11-21 17:37:37171}
Junio C Hamano788eeba2010-12-08 22:50:43172div.quoteblock > div.attribution {
173 padding-top: 0.5em;
Junio C Hamano3b70d3c2009-11-21 17:37:37174 text-align: right;
175}
Junio C Hamano788eeba2010-12-08 22:50:43176
177div.verseblock {
178 padding-left: 2.0em;
179 margin-right: 10%;
180}
181div.verseblock > div.content {
182 white-space: pre;
183}
184div.verseblock > div.attribution {
185 padding-top: 0.75em;
186 text-align: left;
187}
188/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamano3b70d3c2009-11-21 17:37:37189div.verseblock + div.attribution {
190 text-align: left;
191}
192
193div.admonitionblock .icon {
194 vertical-align: top;
195 font-size: 1.1em;
196 font-weight: bold;
197 text-decoration: underline;
198 color: #527bbd;
199 padding-right: 0.5em;
200}
201div.admonitionblock td.content {
202 padding-left: 0.5em;
203 border-left: 2px solid silver;
204}
205
206div.exampleblock > div.content {
207 border-left: 2px solid silver;
208 padding: 0.5em;
209}
210
Junio C Hamano3b70d3c2009-11-21 17:37:37211div.imageblock div.content { padding-left: 0; }
Junio C Hamano3b70d3c2009-11-21 17:37:37212span.image img { border-style: none; }
Junio C Hamano788eeba2010-12-08 22:50:43213a.image:visited { color: white; }
Junio C Hamano3b70d3c2009-11-21 17:37:37214
215dl {
216 margin-top: 0.8em;
217 margin-bottom: 0.8em;
218}
219dt {
220 margin-top: 0.5em;
221 margin-bottom: 0;
Junio C Hamano788eeba2010-12-08 22:50:43222 font-style: normal;
223 color: navy;
Junio C Hamano3b70d3c2009-11-21 17:37:37224}
225dd > *:first-child {
Junio C Hamano788eeba2010-12-08 22:50:43226 margin-top: 0.1em;
Junio C Hamano3b70d3c2009-11-21 17:37:37227}
228
229ul, ol {
230 list-style-position: outside;
231}
Junio C Hamano788eeba2010-12-08 22:50:43232ol.arabic {
233 list-style-type: decimal;
234}
235ol.loweralpha {
Junio C Hamano3b70d3c2009-11-21 17:37:37236 list-style-type: lower-alpha;
237}
Junio C Hamano788eeba2010-12-08 22:50:43238ol.upperalpha {
239 list-style-type: upper-alpha;
240}
241ol.lowerroman {
242 list-style-type: lower-roman;
243}
244ol.upperroman {
245 list-style-type: upper-roman;
246}
247
248div.compact ul, div.compact ol,
249div.compact p, div.compact p,
250div.compact div, div.compact div {
251 margin-top: 0.1em;
252 margin-bottom: 0.1em;
253}
Junio C Hamano3b70d3c2009-11-21 17:37:37254
255div.tableblock > table {
256 border: 3px solid #527bbd;
257}
258thead {
259 font-family: sans-serif;
260 font-weight: bold;
261}
262tfoot {
263 font-weight: bold;
264}
Junio C Hamano788eeba2010-12-08 22:50:43265td > div.verse {
266 white-space: pre;
267}
268p.table {
269 margin-top: 0;
270}
271/* Because the table frame attribute is overriden by CSS in most browsers. */
272div.tableblock > table[frame="void"] {
273 border-style: none;
274}
275div.tableblock > table[frame="hsides"] {
276 border-left-style: none;
277 border-right-style: none;
278}
279div.tableblock > table[frame="vsides"] {
280 border-top-style: none;
281 border-bottom-style: none;
282}
Junio C Hamano3b70d3c2009-11-21 17:37:37283
Junio C Hamano788eeba2010-12-08 22:50:43284
285div.hdlist {
Junio C Hamano3b70d3c2009-11-21 17:37:37286 margin-top: 0.8em;
287 margin-bottom: 0.8em;
288}
Junio C Hamano788eeba2010-12-08 22:50:43289div.hdlist tr {
290 padding-bottom: 15px;
Junio C Hamano3b70d3c2009-11-21 17:37:37291}
Junio C Hamano788eeba2010-12-08 22:50:43292dt.hdlist1.strong, td.hdlist1.strong {
293 font-weight: bold;
294}
295td.hdlist1 {
Junio C Hamano3b70d3c2009-11-21 17:37:37296 vertical-align: top;
Junio C Hamano788eeba2010-12-08 22:50:43297 font-style: normal;
Junio C Hamano3b70d3c2009-11-21 17:37:37298 padding-right: 0.8em;
Junio C Hamano788eeba2010-12-08 22:50:43299 color: navy;
Junio C Hamano3b70d3c2009-11-21 17:37:37300}
Junio C Hamano788eeba2010-12-08 22:50:43301td.hdlist2 {
Junio C Hamano3b70d3c2009-11-21 17:37:37302 vertical-align: top;
303}
Junio C Hamano788eeba2010-12-08 22:50:43304div.hdlist.compact tr {
305 margin: 0;
306 padding-bottom: 0;
307}
308
309.comment {
310 background: yellow;
311}
Junio C Hamano3b70d3c2009-11-21 17:37:37312
313@media print {
314 div#footer-badges { display: none; }
315}
316
317div#toctitle {
318 color: #527bbd;
319 font-family: sans-serif;
320 font-size: 1.1em;
321 font-weight: bold;
322 margin-top: 1.0em;
323 margin-bottom: 0.1em;
324}
325
326div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
327 margin-top: 0;
328 margin-bottom: 0;
329}
330div.toclevel2 {
331 margin-left: 2em;
332 font-size: 0.9em;
333}
334div.toclevel3 {
335 margin-left: 4em;
336 font-size: 0.9em;
337}
338div.toclevel4 {
339 margin-left: 6em;
340 font-size: 0.9em;
341}
Junio C Hamano788eeba2010-12-08 22:50:43342/* Overrides for manpage documents */
343h1 {
344 padding-top: 0.5em;
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver;
347 border-bottom: 2px solid silver;
348}
349h2 {
350 border-style: none;
351}
352div.sectionbody {
353 margin-left: 5%;
354}
355
356@media print {
357 div#toc { display: none; }
358}
359
Junio C Hamano3b70d3c2009-11-21 17:37:37360/* Workarounds for IE6's broken and incomplete CSS2. */
361
362div.sidebar-content {
363 background: #ffffee;
364 border: 1px solid silver;
365 padding: 0.5em;
366}
367div.sidebar-title, div.image-title {
Junio C Hamano788eeba2010-12-08 22:50:43368 color: #527bbd;
Junio C Hamano3b70d3c2009-11-21 17:37:37369 font-family: sans-serif;
370 font-weight: bold;
371 margin-top: 0.0em;
372 margin-bottom: 0.5em;
373}
374
375div.listingblock div.content {
376 border: 1px solid silver;
377 background: #f4f4f4;
378 padding: 0.5em;
379}
380
Junio C Hamano788eeba2010-12-08 22:50:43381div.quoteblock-attribution {
382 padding-top: 0.5em;
383 text-align: right;
384}
385
386div.verseblock-content {
387 white-space: pre;
388}
389div.verseblock-attribution {
390 padding-top: 0.75em;
391 text-align: left;
Junio C Hamano3b70d3c2009-11-21 17:37:37392}
393
394div.exampleblock-content {
395 border-left: 2px solid silver;
396 padding-left: 0.5em;
397}
398
399/* IE6 sets dynamically generated links as visited. */
400div#toc a:visited { color: blue; }
401</style>
Junio C Hamano3b70d3c2009-11-21 17:37:37402</head>
403<body>
404<div id="header">
405<h1>
406git-notes(1) Manual Page
407</h1>
408<h2>NAME</h2>
409<div class="sectionbody">
410<p>git-notes -
Junio C Hamanoa574a092010-06-13 19:57:10411 Add or inspect object notes
Junio C Hamano3b70d3c2009-11-21 17:37:37412</p>
413</div>
414</div>
Junio C Hamano788eeba2010-12-08 22:50:43415<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano3b70d3c2009-11-21 17:37:37416<div class="sectionbody">
417<div class="verseblock">
Junio C Hamano788eeba2010-12-08 22:50:43418<div class="verseblock-content"><em>git notes</em> [list [&lt;object&gt;]]
Junio C Hamanoea90ab32010-03-15 20:32:55419<em>git notes</em> add [-f] [-F &lt;file&gt; | -m &lt;msg&gt; | (-c | -C) &lt;object&gt;] [&lt;object&gt;]
Junio C Hamano31667362010-03-25 00:38:53420<em>git notes</em> copy [-f] ( --stdin | &lt;from-object&gt; &lt;to-object&gt; )
Junio C Hamanoea90ab32010-03-15 20:32:55421<em>git notes</em> append [-F &lt;file&gt; | -m &lt;msg&gt; | (-c | -C) &lt;object&gt;] [&lt;object&gt;]
422<em>git notes</em> edit [&lt;object&gt;]
423<em>git notes</em> show [&lt;object&gt;]
Junio C Hamano788eeba2010-12-08 22:50:43424<em>git notes</em> merge [-v | -q] [-s &lt;strategy&gt; ] &lt;notes_ref&gt;
425<em>git notes</em> merge --commit [-v | -q]
426<em>git notes</em> merge --abort [-v | -q]
Junio C Hamanoea90ab32010-03-15 20:32:55427<em>git notes</em> remove [&lt;object&gt;]
Junio C Hamano788eeba2010-12-08 22:50:43428<em>git notes</em> prune [-n | -v]
429<em>git notes</em> get-ref</div>
430<div class="verseblock-attribution">
431</div></div>
Junio C Hamano3b70d3c2009-11-21 17:37:37432</div>
433<h2 id="_description">DESCRIPTION</h2>
434<div class="sectionbody">
Junio C Hamano788eeba2010-12-08 22:50:43435<div class="paragraph"><p>Adds, removes, or reads notes attached to objects, without touching
Junio C Hamanoa574a092010-06-13 19:57:10436the objects themselves.</p></div>
Junio C Hamano788eeba2010-12-08 22:50:43437<div class="paragraph"><p>By default, notes are saved to and read from <tt>refs/notes/commits</tt>, but
Junio C Hamanoa574a092010-06-13 19:57:10438this default can be overridden. See the OPTIONS, CONFIGURATION, and
439ENVIRONMENT sections below. If this ref does not exist, it will be
440quietly created when it is first needed to store a note.</p></div>
Junio C Hamano788eeba2010-12-08 22:50:43441<div class="paragraph"><p>A typical use of notes is to supplement a commit message without
Junio C Hamanoa574a092010-06-13 19:57:10442changing the commit itself. Notes can be shown by <em>git log</em> along with
443the original commit message. To distinguish these notes from the
Junio C Hamanoea90ab32010-03-15 20:32:55444message stored in the commit object, the notes are indented like the
Junio C Hamano31667362010-03-25 00:38:53445message, after an unindented line saying "Notes (&lt;refname&gt;):" (or
Junio C Hamanoa574a092010-06-13 19:57:10446"Notes:" for <tt>refs/notes/commits</tt>).</p></div>
Junio C Hamano788eeba2010-12-08 22:50:43447<div class="paragraph"><p>To change which notes are shown by <em>git log</em>, see the
Junio C Hamanoa574a092010-06-13 19:57:10448"notes.displayRef" configuration in <a href="git-log.html">git-log(1)</a>.</p></div>
Junio C Hamano788eeba2010-12-08 22:50:43449<div class="paragraph"><p>See the "notes.rewrite.&lt;command&gt;" configuration for a way to carry
Junio C Hamanoa574a092010-06-13 19:57:10450notes across commands that rewrite commits.</p></div>
Junio C Hamano3b70d3c2009-11-21 17:37:37451</div>
452<h2 id="_subcommands">SUBCOMMANDS</h2>
453<div class="sectionbody">
Junio C Hamano788eeba2010-12-08 22:50:43454<div class="dlist"><dl>
455<dt class="hdlist1">
Junio C Hamanoea90ab32010-03-15 20:32:55456list
457</dt>
458<dd>
459<p>
460 List the notes object for a given object. If no object is
461 given, show a list of all note objects and the objects they
462 annotate (in the format "&lt;note object&gt; &lt;annotated object&gt;").
463 This is the default subcommand if no subcommand is given.
464</p>
465</dd>
Junio C Hamano788eeba2010-12-08 22:50:43466<dt class="hdlist1">
Junio C Hamanoea90ab32010-03-15 20:32:55467add
468</dt>
469<dd>
470<p>
471 Add notes for a given object (defaults to HEAD). Abort if the
472 object already has notes (use <tt>-f</tt> to overwrite an
473 existing note).
474</p>
475</dd>
Junio C Hamano788eeba2010-12-08 22:50:43476<dt class="hdlist1">
Junio C Hamanoea90ab32010-03-15 20:32:55477copy
478</dt>
479<dd>
480<p>
481 Copy the notes for the first object onto the second object.
482 Abort if the second object already has notes, or if the first
483 object has none (use -f to overwrite existing notes to the
484 second object). This subcommand is equivalent to:
485 <tt>git notes add [-f] -C $(git notes list &lt;from-object&gt;) &lt;to-object&gt;</tt>
486</p>
Junio C Hamano788eeba2010-12-08 22:50:43487<div class="paragraph"><p>In <tt>--stdin</tt> mode, take lines in the format</p></div>
Junio C Hamano31667362010-03-25 00:38:53488<div class="listingblock">
489<div class="content">
490<pre><tt>&lt;from-object&gt; SP &lt;to-object&gt; [ SP &lt;rest&gt; ] LF</tt></pre>
491</div></div>
Junio C Hamano788eeba2010-12-08 22:50:43492<div class="paragraph"><p>on standard input, and copy the notes from each &lt;from-object&gt; to its
Junio C Hamano31667362010-03-25 00:38:53493corresponding &lt;to-object&gt;. (The optional <tt>&lt;rest&gt;</tt> is ignored so that
494the command can read the input given to the <tt>post-rewrite</tt> hook.)</p></div>
Junio C Hamanoea90ab32010-03-15 20:32:55495</dd>
Junio C Hamano788eeba2010-12-08 22:50:43496<dt class="hdlist1">
Junio C Hamanoea90ab32010-03-15 20:32:55497append
498</dt>
499<dd>
500<p>
501 Append to the notes of an existing object (defaults to HEAD).
502 Creates a new notes object if needed.
503</p>
504</dd>
Junio C Hamano788eeba2010-12-08 22:50:43505<dt class="hdlist1">
Junio C Hamano3b70d3c2009-11-21 17:37:37506edit
507</dt>
508<dd>
509<p>
Junio C Hamanoea90ab32010-03-15 20:32:55510 Edit the notes for a given object (defaults to HEAD).
Junio C Hamano3b70d3c2009-11-21 17:37:37511</p>
512</dd>
Junio C Hamano788eeba2010-12-08 22:50:43513<dt class="hdlist1">
Junio C Hamano3b70d3c2009-11-21 17:37:37514show
515</dt>
516<dd>
517<p>
Junio C Hamanoea90ab32010-03-15 20:32:55518 Show the notes for a given object (defaults to HEAD).
519</p>
520</dd>
Junio C Hamano788eeba2010-12-08 22:50:43521<dt class="hdlist1">
522merge
523</dt>
524<dd>
525<p>
526 Merge the given notes ref into the current notes ref.
527 This will try to merge the changes made by the given
528 notes ref (called "remote") since the merge-base (if
529 any) into the current notes ref (called "local").
530</p>
531<div class="paragraph"><p>If conflicts arise and a strategy for automatically resolving
532conflicting notes (see the -s/--strategy option) is not given,
533the "manual" resolver is used. This resolver checks out the
534conflicting notes in a special worktree (<tt>.git/NOTES_MERGE_WORKTREE</tt>),
535and instructs the user to manually resolve the conflicts there.
536When done, the user can either finalize the merge with
537<em>git notes merge --commit</em>, or abort the merge with
538<em>git notes merge --abort</em>.</p></div>
539</dd>
540<dt class="hdlist1">
Junio C Hamanoea90ab32010-03-15 20:32:55541remove
542</dt>
543<dd>
544<p>
545 Remove the notes for a given object (defaults to HEAD).
546 This is equivalent to specifying an empty note message to
547 the <tt>edit</tt> subcommand.
548</p>
549</dd>
Junio C Hamano788eeba2010-12-08 22:50:43550<dt class="hdlist1">
Junio C Hamanoea90ab32010-03-15 20:32:55551prune
552</dt>
553<dd>
554<p>
555 Remove all notes for non-existing/unreachable objects.
Junio C Hamano3b70d3c2009-11-21 17:37:37556</p>
557</dd>
Junio C Hamano788eeba2010-12-08 22:50:43558<dt class="hdlist1">
559get-ref
560</dt>
561<dd>
562<p>
563 Print the current notes ref. This provides an easy way to
564 retrieve the current notes ref (e.g. from scripts).
565</p>
566</dd>
Junio C Hamano3b70d3c2009-11-21 17:37:37567</dl></div>
568</div>
569<h2 id="_options">OPTIONS</h2>
570<div class="sectionbody">
Junio C Hamano788eeba2010-12-08 22:50:43571<div class="dlist"><dl>
572<dt class="hdlist1">
Junio C Hamanoea90ab32010-03-15 20:32:55573-f
574</dt>
Junio C Hamano788eeba2010-12-08 22:50:43575<dt class="hdlist1">
Junio C Hamanoea90ab32010-03-15 20:32:55576--force
577</dt>
578<dd>
579<p>
580 When adding notes to an object that already has notes,
581 overwrite the existing notes (instead of aborting).
582</p>
583</dd>
Junio C Hamano788eeba2010-12-08 22:50:43584<dt class="hdlist1">
Junio C Hamano3b70d3c2009-11-21 17:37:37585-m &lt;msg&gt;
586</dt>
Junio C Hamano788eeba2010-12-08 22:50:43587<dt class="hdlist1">
Junio C Hamanoea90ab32010-03-15 20:32:55588--message=&lt;msg&gt;
589</dt>
Junio C Hamano3b70d3c2009-11-21 17:37:37590<dd>
591<p>
592 Use the given note message (instead of prompting).
Junio C Hamanoea90ab32010-03-15 20:32:55593 If multiple <tt>-m</tt> options are given, their values
594 are concatenated as separate paragraphs.
Junio C Hamanoa574a092010-06-13 19:57:10595 Lines starting with <tt>#</tt> and empty lines other than a
596 single line between paragraphs will be stripped out.
Junio C Hamano3b70d3c2009-11-21 17:37:37597</p>
598</dd>
Junio C Hamano788eeba2010-12-08 22:50:43599<dt class="hdlist1">
Junio C Hamano3b70d3c2009-11-21 17:37:37600-F &lt;file&gt;
601</dt>
Junio C Hamano788eeba2010-12-08 22:50:43602<dt class="hdlist1">
Junio C Hamanoea90ab32010-03-15 20:32:55603--file=&lt;file&gt;
604</dt>
Junio C Hamano3b70d3c2009-11-21 17:37:37605<dd>
606<p>
607 Take the note message from the given file. Use <em>-</em> to
608 read the note message from the standard input.
Junio C Hamanoa574a092010-06-13 19:57:10609 Lines starting with <tt>#</tt> and empty lines other than a
610 single line between paragraphs will be stripped out.
Junio C Hamanoea90ab32010-03-15 20:32:55611</p>
612</dd>
Junio C Hamano788eeba2010-12-08 22:50:43613<dt class="hdlist1">
Junio C Hamanoea90ab32010-03-15 20:32:55614-C &lt;object&gt;
615</dt>
Junio C Hamano788eeba2010-12-08 22:50:43616<dt class="hdlist1">
Junio C Hamanoea90ab32010-03-15 20:32:55617--reuse-message=&lt;object&gt;
618</dt>
619<dd>
620<p>
Junio C Hamanoa574a092010-06-13 19:57:10621 Take the note message from the given blob object (for
622 example, another note).
Junio C Hamanoea90ab32010-03-15 20:32:55623</p>
624</dd>
Junio C Hamano788eeba2010-12-08 22:50:43625<dt class="hdlist1">
Junio C Hamanoea90ab32010-03-15 20:32:55626-c &lt;object&gt;
627</dt>
Junio C Hamano788eeba2010-12-08 22:50:43628<dt class="hdlist1">
Junio C Hamanoea90ab32010-03-15 20:32:55629--reedit-message=&lt;object&gt;
630</dt>
631<dd>
632<p>
633 Like <em>-C</em>, but with <em>-c</em> the editor is invoked, so that
634 the user can further edit the note message.
Junio C Hamano3b70d3c2009-11-21 17:37:37635</p>
636</dd>
Junio C Hamano788eeba2010-12-08 22:50:43637<dt class="hdlist1">
Junio C Hamano31667362010-03-25 00:38:53638--ref &lt;ref&gt;
639</dt>
640<dd>
641<p>
Junio C Hamanoa574a092010-06-13 19:57:10642 Manipulate the notes tree in &lt;ref&gt;. This overrides
643 <em>GIT_NOTES_REF</em> and the "core.notesRef" configuration. The ref
Junio C Hamano31667362010-03-25 00:38:53644 is taken to be in <tt>refs/notes/</tt> if it is not qualified.
645</p>
646</dd>
Junio C Hamano788eeba2010-12-08 22:50:43647<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:10648-n
649</dt>
Junio C Hamano788eeba2010-12-08 22:50:43650<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:14651--dry-run
652</dt>
Junio C Hamanoa574a092010-06-13 19:57:10653<dd>
654<p>
655 Do not remove anything; just report the object names whose notes
656 would be removed.
657</p>
658</dd>
Junio C Hamano788eeba2010-12-08 22:50:43659<dt class="hdlist1">
660-s &lt;strategy&gt;
661</dt>
662<dt class="hdlist1">
663--strategy=&lt;strategy&gt;
664</dt>
665<dd>
666<p>
667 When merging notes, resolve notes conflicts using the given
668 strategy. The following strategies are recognized: "manual"
669 (default), "ours", "theirs", "union" and "cat_sort_uniq".
670 See the "NOTES MERGE STRATEGIES" section below for more
671 information on each notes merge strategy.
672</p>
673</dd>
674<dt class="hdlist1">
675--commit
676</dt>
677<dd>
678<p>
679 Finalize an in-progress <em>git notes merge</em>. Use this option
680 when you have resolved the conflicts that <em>git notes merge</em>
681 stored in .git/NOTES_MERGE_WORKTREE. This amends the partial
682 merge commit created by <em>git notes merge</em> (stored in
683 .git/NOTES_MERGE_PARTIAL) by adding the notes in
684 .git/NOTES_MERGE_WORKTREE. The notes ref stored in the
685 .git/NOTES_MERGE_REF symref is updated to the resulting commit.
686</p>
687</dd>
688<dt class="hdlist1">
689--abort
690</dt>
691<dd>
692<p>
693 Abort/reset a in-progress <em>git notes merge</em>, i.e. a notes merge
694 with conflicts. This simply removes all files related to the
695 notes merge.
696</p>
697</dd>
698<dt class="hdlist1">
699-q
700</dt>
701<dt class="hdlist1">
702--quiet
703</dt>
704<dd>
705<p>
706 When merging notes, operate quietly.
707</p>
708</dd>
709<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:10710-v
711</dt>
Junio C Hamano788eeba2010-12-08 22:50:43712<dt class="hdlist1">
Junio C Hamanoe85e36f2010-08-10 05:30:14713--verbose
714</dt>
Junio C Hamanoa574a092010-06-13 19:57:10715<dd>
716<p>
Junio C Hamano788eeba2010-12-08 22:50:43717 When merging notes, be more verbose.
718 When pruning notes, report all object names whose notes are
719 removed.
Junio C Hamanoa574a092010-06-13 19:57:10720</p>
721</dd>
Junio C Hamano3b70d3c2009-11-21 17:37:37722</dl></div>
723</div>
Junio C Hamanoa574a092010-06-13 19:57:10724<h2 id="_discussion">DISCUSSION</h2>
Junio C Hamano31667362010-03-25 00:38:53725<div class="sectionbody">
Junio C Hamano788eeba2010-12-08 22:50:43726<div class="paragraph"><p>Commit notes are blobs containing extra information about an object
727(usually information to supplement a commit&#8217;s message). These blobs
Junio C Hamanoa574a092010-06-13 19:57:10728are taken from notes refs. A notes ref is usually a branch which
729contains "files" whose paths are the object names for the objects
730they describe, with some directory separators included for performance
731reasons <br />[Permitted pathnames have the form
732<em>ab</em><tt>/</tt><em>cd</em><tt>/</tt><em>ef</em><tt>/</tt><em>&#8230;</em><tt>/</tt><em>abcdef&#8230;</em>: a sequence of directory
733names of two hexadecimal digits each followed by a filename with the
734rest of the object ID.]<br />.</p></div>
Junio C Hamano788eeba2010-12-08 22:50:43735<div class="paragraph"><p>Every notes change creates a new commit at the specified notes ref.
Junio C Hamano31667362010-03-25 00:38:53736You can therefore inspect the history of the notes by invoking, e.g.,
Junio C Hamanoa574a092010-06-13 19:57:10737<tt>git log -p notes/commits</tt>. Currently the commit message only records
738which operation triggered the update, and the commit authorship is
739determined according to the usual rules (see <a href="git-commit.html">git-commit(1)</a>).
740These details may change in the future.</p></div>
Junio C Hamano788eeba2010-12-08 22:50:43741<div class="paragraph"><p>It is also permitted for a notes ref to point directly to a tree
Junio C Hamanoa574a092010-06-13 19:57:10742object, in which case the history of the notes can be read with
743<tt>git log -p -g &lt;refname&gt;</tt>.</p></div>
744</div>
Junio C Hamano788eeba2010-12-08 22:50:43745<h2 id="_notes_merge_strategies">NOTES MERGE STRATEGIES</h2>
746<div class="sectionbody">
747<div class="paragraph"><p>The default notes merge strategy is "manual", which checks out
748conflicting notes in a special work tree for resolving notes conflicts
749(<tt>.git/NOTES_MERGE_WORKTREE</tt>), and instructs the user to resolve the
750conflicts in that work tree.
751When done, the user can either finalize the merge with
752<em>git notes merge --commit</em>, or abort the merge with
753<em>git notes merge --abort</em>.</p></div>
754<div class="paragraph"><p>"ours" automatically resolves conflicting notes in favor of the local
755version (i.e. the current notes ref).</p></div>
756<div class="paragraph"><p>"theirs" automatically resolves notes conflicts in favor of the remote
757version (i.e. the given notes ref being merged into the current notes
758ref).</p></div>
759<div class="paragraph"><p>"union" automatically resolves notes conflicts by concatenating the
760local and remote versions.</p></div>
761<div class="paragraph"><p>"cat_sort_uniq" is similar to "union", but in addition to concatenating
762the local and remote versions, this strategy also sorts the resulting
763lines, and removes duplicate lines from the result. This is equivalent
764to applying the "cat | sort | uniq" shell pipeline to the local and
765remote versions. This strategy is useful if the notes follow a line-based
766format where one wants to avoid duplicated lines in the merge result.
767Note that if either the local or remote version contain duplicate lines
768prior to the merge, these will also be removed by this notes merge
769strategy.</p></div>
770</div>
Junio C Hamanoa574a092010-06-13 19:57:10771<h2 id="_examples">EXAMPLES</h2>
772<div class="sectionbody">
Junio C Hamano788eeba2010-12-08 22:50:43773<div class="paragraph"><p>You can use notes to add annotations with information that was not
Junio C Hamanoa574a092010-06-13 19:57:10774available at the time a commit was written.</p></div>
775<div class="listingblock">
776<div class="content">
777<pre><tt>$ git notes add -m 'Tested-by: Johannes Sixt &lt;j6t@kdbg.org&gt;' 72a144e2
778$ git show -s 72a144e
779[...]
780 Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
781
782Notes:
783 Tested-by: Johannes Sixt &lt;j6t@kdbg.org&gt;</tt></pre>
784</div></div>
Junio C Hamano788eeba2010-12-08 22:50:43785<div class="paragraph"><p>In principle, a note is a regular Git blob, and any kind of
Junio C Hamanoa574a092010-06-13 19:57:10786(non-)format is accepted. You can binary-safely create notes from
787arbitrary files using <em>git hash-object</em>:</p></div>
788<div class="listingblock">
789<div class="content">
790<pre><tt>$ cc *.c
791$ blob=$(git hash-object -w a.out)
792$ git notes --ref=built add -C "$blob" HEAD</tt></pre>
793</div></div>
Junio C Hamano788eeba2010-12-08 22:50:43794<div class="paragraph"><p>Of course, it doesn&#8217;t make much sense to display non-text-format notes
795with <em>git log</em>, so if you use such notes, you&#8217;ll probably need to write
Junio C Hamanoa574a092010-06-13 19:57:10796some special-purpose tools to do something useful with them.</p></div>
797</div>
798<h2 id="_configuration">CONFIGURATION</h2>
799<div class="sectionbody">
Junio C Hamano788eeba2010-12-08 22:50:43800<div class="dlist"><dl>
801<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:10802core.notesRef
803</dt>
804<dd>
805<p>
806 Notes ref to read and manipulate instead of
807 <tt>refs/notes/commits</tt>. Must be an unabbreviated ref name.
808 This setting can be overridden through the environment and
809 command line.
810</p>
811</dd>
Junio C Hamano788eeba2010-12-08 22:50:43812<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:10813notes.displayRef
814</dt>
815<dd>
816<p>
817 Which ref (or refs, if a glob or specified more than once), in
818 addition to the default set by <tt>core.notesRef</tt> or
819 <em>GIT_NOTES_REF</em>, to read notes from when showing commit
820 messages with the <em>git log</em> family of commands.
821 This setting can be overridden on the command line or by the
822 <em>GIT_NOTES_DISPLAY_REF</em> environment variable.
823 See <a href="git-log.html">git-log(1)</a>.
824</p>
825</dd>
Junio C Hamano788eeba2010-12-08 22:50:43826<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:10827notes.rewrite.&lt;command&gt;
828</dt>
829<dd>
830<p>
831 When rewriting commits with &lt;command&gt; (currently <tt>amend</tt> or
832 <tt>rebase</tt>), if this variable is <tt>false</tt>, git will not copy
833 notes from the original to the rewritten commit. Defaults to
834 <tt>true</tt>. See also "<tt>notes.rewriteRef</tt>" below.
835</p>
Junio C Hamano788eeba2010-12-08 22:50:43836<div class="paragraph"><p>This setting can be overridden by the <em>GIT_NOTES_REWRITE_REF</em>
Junio C Hamanoa574a092010-06-13 19:57:10837environment variable.</p></div>
838</dd>
Junio C Hamano788eeba2010-12-08 22:50:43839<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:10840notes.rewriteMode
841</dt>
842<dd>
843<p>
844 When copying notes during a rewrite, what to do if the target
845 commit already has a note. Must be one of <tt>overwrite</tt>,
846 <tt>concatenate</tt>, and <tt>ignore</tt>. Defaults to <tt>concatenate</tt>.
847</p>
Junio C Hamano788eeba2010-12-08 22:50:43848<div class="paragraph"><p>This setting can be overridden with the <tt>GIT_NOTES_REWRITE_MODE</tt>
Junio C Hamanoa574a092010-06-13 19:57:10849environment variable.</p></div>
850</dd>
Junio C Hamano788eeba2010-12-08 22:50:43851<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:10852notes.rewriteRef
853</dt>
854<dd>
855<p>
856 When copying notes during a rewrite, specifies the (fully
857 qualified) ref whose notes should be copied. May be a glob,
858 in which case notes in all matching refs will be copied. You
859 may also specify this configuration several times.
860</p>
Junio C Hamano788eeba2010-12-08 22:50:43861<div class="paragraph"><p>Does not have a default value; you must configure this variable to
Junio C Hamanoa574a092010-06-13 19:57:10862enable note rewriting.</p></div>
Junio C Hamano788eeba2010-12-08 22:50:43863<div class="paragraph"><p>Can be overridden with the <em>GIT_NOTES_REWRITE_REF</em> environment variable.</p></div>
Junio C Hamanoa574a092010-06-13 19:57:10864</dd>
865</dl></div>
866</div>
867<h2 id="_environment">ENVIRONMENT</h2>
868<div class="sectionbody">
Junio C Hamano788eeba2010-12-08 22:50:43869<div class="dlist"><dl>
870<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:10871<em>GIT_NOTES_REF</em>
872</dt>
873<dd>
874<p>
875 Which ref to manipulate notes from, instead of <tt>refs/notes/commits</tt>.
876 This overrides the <tt>core.notesRef</tt> setting.
877</p>
878</dd>
Junio C Hamano788eeba2010-12-08 22:50:43879<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:10880<em>GIT_NOTES_DISPLAY_REF</em>
881</dt>
882<dd>
883<p>
884 Colon-delimited list of refs or globs indicating which refs,
885 in addition to the default from <tt>core.notesRef</tt> or
886 <em>GIT_NOTES_REF</em>, to read notes from when showing commit
887 messages.
888 This overrides the <tt>notes.displayRef</tt> setting.
889</p>
Junio C Hamano788eeba2010-12-08 22:50:43890<div class="paragraph"><p>A warning will be issued for refs that do not exist, but a glob that
Junio C Hamanoa574a092010-06-13 19:57:10891does not match any refs is silently ignored.</p></div>
892</dd>
Junio C Hamano788eeba2010-12-08 22:50:43893<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:10894<em>GIT_NOTES_REWRITE_MODE</em>
895</dt>
896<dd>
897<p>
898 When copying notes during a rewrite, what to do if the target
899 commit already has a note.
900 Must be one of <tt>overwrite</tt>, <tt>concatenate</tt>, and <tt>ignore</tt>.
901 This overrides the <tt>core.rewriteMode</tt> setting.
902</p>
903</dd>
Junio C Hamano788eeba2010-12-08 22:50:43904<dt class="hdlist1">
Junio C Hamanoa574a092010-06-13 19:57:10905<em>GIT_NOTES_REWRITE_REF</em>
906</dt>
907<dd>
908<p>
909 When rewriting commits, which notes to copy from the original
910 to the rewritten commit. Must be a colon-delimited list of
911 refs or globs.
912</p>
Junio C Hamano788eeba2010-12-08 22:50:43913<div class="paragraph"><p>If not set in the environment, the list of notes to copy depends
Junio C Hamanoa574a092010-06-13 19:57:10914on the <tt>notes.rewrite.&lt;command&gt;</tt> and <tt>notes.rewriteRef</tt> settings.</p></div>
915</dd>
916</dl></div>
Junio C Hamano31667362010-03-25 00:38:53917</div>
Junio C Hamano3b70d3c2009-11-21 17:37:37918<h2 id="_author">Author</h2>
919<div class="sectionbody">
Junio C Hamano788eeba2010-12-08 22:50:43920<div class="paragraph"><p>Written by Johannes Schindelin &lt;<a href="mailto:johannes.schindelin@gmx.de">johannes.schindelin@gmx.de</a>&gt; and
921Johan Herland &lt;<a href="mailto:johan@herland.net">johan@herland.net</a>&gt;</p></div>
Junio C Hamano3b70d3c2009-11-21 17:37:37922</div>
923<h2 id="_documentation">Documentation</h2>
924<div class="sectionbody">
Junio C Hamano788eeba2010-12-08 22:50:43925<div class="paragraph"><p>Documentation by Johannes Schindelin and Johan Herland</p></div>
Junio C Hamano3b70d3c2009-11-21 17:37:37926</div>
927<h2 id="_git">GIT</h2>
928<div class="sectionbody">
Junio C Hamano788eeba2010-12-08 22:50:43929<div class="paragraph"><p>Part of the <a href="git.html">git(7)</a> suite</p></div>
Junio C Hamano3b70d3c2009-11-21 17:37:37930</div>
931<div id="footer">
932<div id="footer-text">
Junio C Hamano788eeba2010-12-08 22:50:43933Last updated 2010-12-08 22:49:27 UTC
Junio C Hamano3b70d3c2009-11-21 17:37:37934</div>
935</div>
936</body>
937</html>