Autogenerated HTML docs for v1.7.7-419-g87009
[git/jnareb-git.git] / git-notes.html
blob759a0ff1e7961259e77e1fabc3cff3788c31a623
1 <!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" />
6 <meta name="generator" content="AsciiDoc 8.5.2" />
7 <title>git-notes(1)</title>
8 <style type="text/css">
9 /* Debug borders */
10 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
12 border: 1px solid red;
16 body {
17 margin: 1em 5% 1em 5%;
20 a {
21 color: blue;
22 text-decoration: underline;
24 a:visited {
25 color: fuchsia;
28 em {
29 font-style: italic;
30 color: navy;
33 strong {
34 font-weight: bold;
35 color: #083194;
38 tt {
39 color: navy;
42 h1, 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;
50 h1, h2, h3 {
51 border-bottom: 2px solid silver;
53 h2 {
54 padding-top: 0.5em;
56 h3 {
57 float: left;
59 h3 + * {
60 clear: left;
63 div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
68 hr {
69 border: 1px solid silver;
72 p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
77 ul, ol, li > p {
78 margin-top: 0;
81 pre {
82 padding: 0;
83 margin: 0;
86 span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
92 span#email {
94 span#revnumber, span#revdate, span#revremark {
95 font-family: sans-serif;
98 div#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;
105 div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
109 div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
114 div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
118 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120 div.admonitionblock {
121 margin-top: 1.0em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.0em;
126 margin-bottom: 2.0em;
127 margin-right: 10%;
128 color: #606060;
131 div.content { /* Block element content. */
132 padding: 0;
135 /* Block element titles. */
136 div.title, caption.title {
137 color: #527bbd;
138 font-family: sans-serif;
139 font-weight: bold;
140 text-align: left;
141 margin-top: 1.0em;
142 margin-bottom: 0.5em;
144 div.title + * {
145 margin-top: 0;
148 td div.title:first-child {
149 margin-top: 0.0em;
151 div.content div.title:first-child {
152 margin-top: 0.0em;
154 div.content + div.title {
155 margin-top: 0.0em;
158 div.sidebarblock > div.content {
159 background: #ffffee;
160 border: 1px solid silver;
161 padding: 0.5em;
164 div.listingblock > div.content {
165 border: 1px solid silver;
166 background: #f4f4f4;
167 padding: 0.5em;
170 div.quoteblock, div.verseblock {
171 padding-left: 1.0em;
172 margin-left: 1.0em;
173 margin-right: 10%;
174 border-left: 5px solid #dddddd;
175 color: #777777;
178 div.quoteblock > div.attribution {
179 padding-top: 0.5em;
180 text-align: right;
183 div.verseblock > div.content {
184 white-space: pre;
186 div.verseblock > div.attribution {
187 padding-top: 0.75em;
188 text-align: left;
190 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
191 div.verseblock + div.attribution {
192 text-align: left;
195 div.admonitionblock .icon {
196 vertical-align: top;
197 font-size: 1.1em;
198 font-weight: bold;
199 text-decoration: underline;
200 color: #527bbd;
201 padding-right: 0.5em;
203 div.admonitionblock td.content {
204 padding-left: 0.5em;
205 border-left: 3px solid #dddddd;
208 div.exampleblock > div.content {
209 border-left: 3px solid #dddddd;
210 padding-left: 0.5em;
213 div.imageblock div.content { padding-left: 0; }
214 span.image img { border-style: none; }
215 a.image:visited { color: white; }
217 dl {
218 margin-top: 0.8em;
219 margin-bottom: 0.8em;
221 dt {
222 margin-top: 0.5em;
223 margin-bottom: 0;
224 font-style: normal;
225 color: navy;
227 dd > *:first-child {
228 margin-top: 0.1em;
231 ul, ol {
232 list-style-position: outside;
234 ol.arabic {
235 list-style-type: decimal;
237 ol.loweralpha {
238 list-style-type: lower-alpha;
240 ol.upperalpha {
241 list-style-type: upper-alpha;
243 ol.lowerroman {
244 list-style-type: lower-roman;
246 ol.upperroman {
247 list-style-type: upper-roman;
250 div.compact ul, div.compact ol,
251 div.compact p, div.compact p,
252 div.compact div, div.compact div {
253 margin-top: 0.1em;
254 margin-bottom: 0.1em;
257 div.tableblock > table {
258 border: 3px solid #527bbd;
260 thead, p.table.header {
261 font-family: sans-serif;
262 font-weight: bold;
264 tfoot {
265 font-weight: bold;
267 td > div.verse {
268 white-space: pre;
270 p.table {
271 margin-top: 0;
273 /* Because the table frame attribute is overriden by CSS in most browsers. */
274 div.tableblock > table[frame="void"] {
275 border-style: none;
277 div.tableblock > table[frame="hsides"] {
278 border-left-style: none;
279 border-right-style: none;
281 div.tableblock > table[frame="vsides"] {
282 border-top-style: none;
283 border-bottom-style: none;
287 div.hdlist {
288 margin-top: 0.8em;
289 margin-bottom: 0.8em;
291 div.hdlist tr {
292 padding-bottom: 15px;
294 dt.hdlist1.strong, td.hdlist1.strong {
295 font-weight: bold;
297 td.hdlist1 {
298 vertical-align: top;
299 font-style: normal;
300 padding-right: 0.8em;
301 color: navy;
303 td.hdlist2 {
304 vertical-align: top;
306 div.hdlist.compact tr {
307 margin: 0;
308 padding-bottom: 0;
311 .comment {
312 background: yellow;
315 .footnote, .footnoteref {
316 font-size: 0.8em;
319 span.footnote, span.footnoteref {
320 vertical-align: super;
323 #footnotes {
324 margin: 20px 0 20px 0;
325 padding: 7px 0 0 0;
328 #footnotes div.footnote {
329 margin: 0 0 5px 0;
332 #footnotes hr {
333 border: none;
334 border-top: 1px solid silver;
335 height: 1px;
336 text-align: left;
337 margin-left: 0;
338 width: 20%;
339 min-width: 100px;
343 @media print {
344 div#footer-badges { display: none; }
347 div#toc {
348 margin-bottom: 2.5em;
351 div#toctitle {
352 color: #527bbd;
353 font-family: sans-serif;
354 font-size: 1.1em;
355 font-weight: bold;
356 margin-top: 1.0em;
357 margin-bottom: 0.1em;
360 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
361 margin-top: 0;
362 margin-bottom: 0;
364 div.toclevel2 {
365 margin-left: 2em;
366 font-size: 0.9em;
368 div.toclevel3 {
369 margin-left: 4em;
370 font-size: 0.9em;
372 div.toclevel4 {
373 margin-left: 6em;
374 font-size: 0.9em;
376 /* Overrides for manpage documents */
377 h1 {
378 padding-top: 0.5em;
379 padding-bottom: 0.5em;
380 border-top: 2px solid silver;
381 border-bottom: 2px solid silver;
383 h2 {
384 border-style: none;
386 div.sectionbody {
387 margin-left: 5%;
390 @media print {
391 div#toc { display: none; }
394 /* Workarounds for IE6's broken and incomplete CSS2. */
396 div.sidebar-content {
397 background: #ffffee;
398 border: 1px solid silver;
399 padding: 0.5em;
401 div.sidebar-title, div.image-title {
402 color: #527bbd;
403 font-family: sans-serif;
404 font-weight: bold;
405 margin-top: 0.0em;
406 margin-bottom: 0.5em;
409 div.listingblock div.content {
410 border: 1px solid silver;
411 background: #f4f4f4;
412 padding: 0.5em;
415 div.quoteblock-attribution {
416 padding-top: 0.5em;
417 text-align: right;
420 div.verseblock-content {
421 white-space: pre;
423 div.verseblock-attribution {
424 padding-top: 0.75em;
425 text-align: left;
428 div.exampleblock-content {
429 border-left: 3px solid #dddddd;
430 padding-left: 0.5em;
433 /* IE6 sets dynamically generated links as visited. */
434 div#toc a:visited { color: blue; }
435 </style>
436 <script type="text/javascript">
437 /*<![CDATA[*/
438 window.onload = function(){asciidoc.footnotes();}
439 var asciidoc = { // Namespace.
441 /////////////////////////////////////////////////////////////////////
442 // Table Of Contents generator
443 /////////////////////////////////////////////////////////////////////
445 /* Author: Mihai Bazon, September 2002
446 * http://students.infoiasi.ro/~mishoo
448 * Table Of Content generator
449 * Version: 0.4
451 * Feel free to use this script under the terms of the GNU General Public
452 * License, as long as you do not remove or alter this notice.
455 /* modified by Troy D. Hanson, September 2006. License: GPL */
456 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
458 // toclevels = 1..4.
459 toc: function (toclevels) {
461 function getText(el) {
462 var text = "";
463 for (var i = el.firstChild; i != null; i = i.nextSibling) {
464 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
465 text += i.data;
466 else if (i.firstChild != null)
467 text += getText(i);
469 return text;
472 function TocEntry(el, text, toclevel) {
473 this.element = el;
474 this.text = text;
475 this.toclevel = toclevel;
478 function tocEntries(el, toclevels) {
479 var result = new Array;
480 var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
481 // Function that scans the DOM tree for header elements (the DOM2
482 // nodeIterator API would be a better technique but not supported by all
483 // browsers).
484 var iterate = function (el) {
485 for (var i = el.firstChild; i != null; i = i.nextSibling) {
486 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
487 var mo = re.exec(i.tagName);
488 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
489 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
491 iterate(i);
495 iterate(el);
496 return result;
499 var toc = document.getElementById("toc");
500 var entries = tocEntries(document.getElementById("content"), toclevels);
501 for (var i = 0; i < entries.length; ++i) {
502 var entry = entries[i];
503 if (entry.element.id == "")
504 entry.element.id = "_toc_" + i;
505 var a = document.createElement("a");
506 a.href = "#" + entry.element.id;
507 a.appendChild(document.createTextNode(entry.text));
508 var div = document.createElement("div");
509 div.appendChild(a);
510 div.className = "toclevel" + entry.toclevel;
511 toc.appendChild(div);
513 if (entries.length == 0)
514 toc.parentNode.removeChild(toc);
518 /////////////////////////////////////////////////////////////////////
519 // Footnotes generator
520 /////////////////////////////////////////////////////////////////////
522 /* Based on footnote generation code from:
523 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
526 footnotes: function () {
527 var cont = document.getElementById("content");
528 var noteholder = document.getElementById("footnotes");
529 var spans = cont.getElementsByTagName("span");
530 var refs = {};
531 var n = 0;
532 for (i=0; i<spans.length; i++) {
533 if (spans[i].className == "footnote") {
534 n++;
535 // Use [\s\S] in place of . so multi-line matches work.
536 // Because JavaScript has no s (dotall) regex flag.
537 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
538 noteholder.innerHTML +=
539 "<div class='footnote' id='_footnote_" + n + "'>" +
540 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
541 n + "</a>. " + note + "</div>";
542 spans[i].innerHTML =
543 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
544 "' title='View footnote' class='footnote'>" + n + "</a>]";
545 var id =spans[i].getAttribute("id");
546 if (id != null) refs["#"+id] = n;
549 if (n == 0)
550 noteholder.parentNode.removeChild(noteholder);
551 else {
552 // Process footnoterefs.
553 for (i=0; i<spans.length; i++) {
554 if (spans[i].className == "footnoteref") {
555 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
556 href = href.match(/#.*/)[0]; // Because IE return full URL.
557 n = refs[href];
558 spans[i].innerHTML =
559 "[<a href='#_footnote_" + n +
560 "' title='View footnote' class='footnote'>" + n + "</a>]";
567 /*]]>*/
568 </script>
569 </head>
570 <body>
571 <div id="header">
572 <h1>
573 git-notes(1) Manual Page
574 </h1>
575 <h2>NAME</h2>
576 <div class="sectionbody">
577 <p>git-notes -
578 Add or inspect object notes
579 </p>
580 </div>
581 </div>
582 <div id="content">
583 <h2 id="_synopsis">SYNOPSIS</h2>
584 <div class="sectionbody">
585 <div class="verseblock">
586 <div class="verseblock-content"><em>git notes</em> [list [&lt;object&gt;]]
587 <em>git notes</em> add [-f] [-F &lt;file&gt; | -m &lt;msg&gt; | (-c | -C) &lt;object&gt;] [&lt;object&gt;]
588 <em>git notes</em> copy [-f] ( --stdin | &lt;from-object&gt; &lt;to-object&gt; )
589 <em>git notes</em> append [-F &lt;file&gt; | -m &lt;msg&gt; | (-c | -C) &lt;object&gt;] [&lt;object&gt;]
590 <em>git notes</em> edit [&lt;object&gt;]
591 <em>git notes</em> show [&lt;object&gt;]
592 <em>git notes</em> merge [-v | -q] [-s &lt;strategy&gt; ] &lt;notes_ref&gt;
593 <em>git notes</em> merge --commit [-v | -q]
594 <em>git notes</em> merge --abort [-v | -q]
595 <em>git notes</em> remove [--ignore-missing] [--stdin] [&lt;object&gt;&#8230;]
596 <em>git notes</em> prune [-n | -v]
597 <em>git notes</em> get-ref</div>
598 <div class="verseblock-attribution">
599 </div></div>
600 </div>
601 <h2 id="_description">DESCRIPTION</h2>
602 <div class="sectionbody">
603 <div class="paragraph"><p>Adds, removes, or reads notes attached to objects, without touching
604 the objects themselves.</p></div>
605 <div class="paragraph"><p>By default, notes are saved to and read from <tt>refs/notes/commits</tt>, but
606 this default can be overridden. See the OPTIONS, CONFIGURATION, and
607 ENVIRONMENT sections below. If this ref does not exist, it will be
608 quietly created when it is first needed to store a note.</p></div>
609 <div class="paragraph"><p>A typical use of notes is to supplement a commit message without
610 changing the commit itself. Notes can be shown by <em>git log</em> along with
611 the original commit message. To distinguish these notes from the
612 message stored in the commit object, the notes are indented like the
613 message, after an unindented line saying "Notes (&lt;refname&gt;):" (or
614 "Notes:" for <tt>refs/notes/commits</tt>).</p></div>
615 <div class="paragraph"><p>To change which notes are shown by <em>git log</em>, see the
616 "notes.displayRef" configuration in <a href="git-log.html">git-log(1)</a>.</p></div>
617 <div class="paragraph"><p>See the "notes.rewrite.&lt;command&gt;" configuration for a way to carry
618 notes across commands that rewrite commits.</p></div>
619 </div>
620 <h2 id="_subcommands">SUBCOMMANDS</h2>
621 <div class="sectionbody">
622 <div class="dlist"><dl>
623 <dt class="hdlist1">
624 list
625 </dt>
626 <dd>
628 List the notes object for a given object. If no object is
629 given, show a list of all note objects and the objects they
630 annotate (in the format "&lt;note object&gt; &lt;annotated object&gt;").
631 This is the default subcommand if no subcommand is given.
632 </p>
633 </dd>
634 <dt class="hdlist1">
636 </dt>
637 <dd>
639 Add notes for a given object (defaults to HEAD). Abort if the
640 object already has notes (use <tt>-f</tt> to overwrite existing notes).
641 However, if you&#8217;re using <tt>add</tt> interactively (using an editor
642 to supply the notes contents), then - instead of aborting -
643 the existing notes will be opened in the editor (like the <tt>edit</tt>
644 subcommand).
645 </p>
646 </dd>
647 <dt class="hdlist1">
648 copy
649 </dt>
650 <dd>
652 Copy the notes for the first object onto the second object.
653 Abort if the second object already has notes, or if the first
654 object has none (use -f to overwrite existing notes to the
655 second object). This subcommand is equivalent to:
656 <tt>git notes add [-f] -C $(git notes list &lt;from-object&gt;) &lt;to-object&gt;</tt>
657 </p>
658 <div class="paragraph"><p>In <tt>--stdin</tt> mode, take lines in the format</p></div>
659 <div class="listingblock">
660 <div class="content">
661 <pre><tt>&lt;from-object&gt; SP &lt;to-object&gt; [ SP &lt;rest&gt; ] LF</tt></pre>
662 </div></div>
663 <div class="paragraph"><p>on standard input, and copy the notes from each &lt;from-object&gt; to its
664 corresponding &lt;to-object&gt;. (The optional <tt>&lt;rest&gt;</tt> is ignored so that
665 the command can read the input given to the <tt>post-rewrite</tt> hook.)</p></div>
666 </dd>
667 <dt class="hdlist1">
668 append
669 </dt>
670 <dd>
672 Append to the notes of an existing object (defaults to HEAD).
673 Creates a new notes object if needed.
674 </p>
675 </dd>
676 <dt class="hdlist1">
677 edit
678 </dt>
679 <dd>
681 Edit the notes for a given object (defaults to HEAD).
682 </p>
683 </dd>
684 <dt class="hdlist1">
685 show
686 </dt>
687 <dd>
689 Show the notes for a given object (defaults to HEAD).
690 </p>
691 </dd>
692 <dt class="hdlist1">
693 merge
694 </dt>
695 <dd>
697 Merge the given notes ref into the current notes ref.
698 This will try to merge the changes made by the given
699 notes ref (called "remote") since the merge-base (if
700 any) into the current notes ref (called "local").
701 </p>
702 <div class="paragraph"><p>If conflicts arise and a strategy for automatically resolving
703 conflicting notes (see the -s/--strategy option) is not given,
704 the "manual" resolver is used. This resolver checks out the
705 conflicting notes in a special worktree (<tt>.git/NOTES_MERGE_WORKTREE</tt>),
706 and instructs the user to manually resolve the conflicts there.
707 When done, the user can either finalize the merge with
708 <em>git notes merge --commit</em>, or abort the merge with
709 <em>git notes merge --abort</em>.</p></div>
710 </dd>
711 <dt class="hdlist1">
712 remove
713 </dt>
714 <dd>
716 Remove the notes for given objects (defaults to HEAD). When
717 giving zero or one object from the command line, this is
718 equivalent to specifying an empty note message to
719 the <tt>edit</tt> subcommand.
720 </p>
721 </dd>
722 <dt class="hdlist1">
723 prune
724 </dt>
725 <dd>
727 Remove all notes for non-existing/unreachable objects.
728 </p>
729 </dd>
730 <dt class="hdlist1">
731 get-ref
732 </dt>
733 <dd>
735 Print the current notes ref. This provides an easy way to
736 retrieve the current notes ref (e.g. from scripts).
737 </p>
738 </dd>
739 </dl></div>
740 </div>
741 <h2 id="_options">OPTIONS</h2>
742 <div class="sectionbody">
743 <div class="dlist"><dl>
744 <dt class="hdlist1">
746 </dt>
747 <dt class="hdlist1">
748 --force
749 </dt>
750 <dd>
752 When adding notes to an object that already has notes,
753 overwrite the existing notes (instead of aborting).
754 </p>
755 </dd>
756 <dt class="hdlist1">
757 -m &lt;msg&gt;
758 </dt>
759 <dt class="hdlist1">
760 --message=&lt;msg&gt;
761 </dt>
762 <dd>
764 Use the given note message (instead of prompting).
765 If multiple <tt>-m</tt> options are given, their values
766 are concatenated as separate paragraphs.
767 Lines starting with <tt>#</tt> and empty lines other than a
768 single line between paragraphs will be stripped out.
769 </p>
770 </dd>
771 <dt class="hdlist1">
772 -F &lt;file&gt;
773 </dt>
774 <dt class="hdlist1">
775 --file=&lt;file&gt;
776 </dt>
777 <dd>
779 Take the note message from the given file. Use <em>-</em> to
780 read the note message from the standard input.
781 Lines starting with <tt>#</tt> and empty lines other than a
782 single line between paragraphs will be stripped out.
783 </p>
784 </dd>
785 <dt class="hdlist1">
786 -C &lt;object&gt;
787 </dt>
788 <dt class="hdlist1">
789 --reuse-message=&lt;object&gt;
790 </dt>
791 <dd>
793 Take the given blob object (for example, another note) as the
794 note message. (Use <tt>git notes copy &lt;object&gt;</tt> instead to
795 copy notes between objects.)
796 </p>
797 </dd>
798 <dt class="hdlist1">
799 -c &lt;object&gt;
800 </dt>
801 <dt class="hdlist1">
802 --reedit-message=&lt;object&gt;
803 </dt>
804 <dd>
806 Like <em>-C</em>, but with <em>-c</em> the editor is invoked, so that
807 the user can further edit the note message.
808 </p>
809 </dd>
810 <dt class="hdlist1">
811 --ref &lt;ref&gt;
812 </dt>
813 <dd>
815 Manipulate the notes tree in &lt;ref&gt;. This overrides
816 <em>GIT_NOTES_REF</em> and the "core.notesRef" configuration. The ref
817 is taken to be in <tt>refs/notes/</tt> if it is not qualified.
818 </p>
819 </dd>
820 <dt class="hdlist1">
821 --ignore-missing
822 </dt>
823 <dd>
825 Do not consider it an error to request removing notes from an
826 object that does not have notes attached to it.
827 </p>
828 </dd>
829 <dt class="hdlist1">
830 --stdin
831 </dt>
832 <dd>
834 Also read the object names to remove notes from from the standard
835 input (there is no reason you cannot combine this with object
836 names from the command line).
837 </p>
838 </dd>
839 <dt class="hdlist1">
841 </dt>
842 <dt class="hdlist1">
843 --dry-run
844 </dt>
845 <dd>
847 Do not remove anything; just report the object names whose notes
848 would be removed.
849 </p>
850 </dd>
851 <dt class="hdlist1">
852 -s &lt;strategy&gt;
853 </dt>
854 <dt class="hdlist1">
855 --strategy=&lt;strategy&gt;
856 </dt>
857 <dd>
859 When merging notes, resolve notes conflicts using the given
860 strategy. The following strategies are recognized: "manual"
861 (default), "ours", "theirs", "union" and "cat_sort_uniq".
862 See the "NOTES MERGE STRATEGIES" section below for more
863 information on each notes merge strategy.
864 </p>
865 </dd>
866 <dt class="hdlist1">
867 --commit
868 </dt>
869 <dd>
871 Finalize an in-progress <em>git notes merge</em>. Use this option
872 when you have resolved the conflicts that <em>git notes merge</em>
873 stored in .git/NOTES_MERGE_WORKTREE. This amends the partial
874 merge commit created by <em>git notes merge</em> (stored in
875 .git/NOTES_MERGE_PARTIAL) by adding the notes in
876 .git/NOTES_MERGE_WORKTREE. The notes ref stored in the
877 .git/NOTES_MERGE_REF symref is updated to the resulting commit.
878 </p>
879 </dd>
880 <dt class="hdlist1">
881 --abort
882 </dt>
883 <dd>
885 Abort/reset a in-progress <em>git notes merge</em>, i.e. a notes merge
886 with conflicts. This simply removes all files related to the
887 notes merge.
888 </p>
889 </dd>
890 <dt class="hdlist1">
892 </dt>
893 <dt class="hdlist1">
894 --quiet
895 </dt>
896 <dd>
898 When merging notes, operate quietly.
899 </p>
900 </dd>
901 <dt class="hdlist1">
903 </dt>
904 <dt class="hdlist1">
905 --verbose
906 </dt>
907 <dd>
909 When merging notes, be more verbose.
910 When pruning notes, report all object names whose notes are
911 removed.
912 </p>
913 </dd>
914 </dl></div>
915 </div>
916 <h2 id="_discussion">DISCUSSION</h2>
917 <div class="sectionbody">
918 <div class="paragraph"><p>Commit notes are blobs containing extra information about an object
919 (usually information to supplement a commit&#8217;s message). These blobs
920 are taken from notes refs. A notes ref is usually a branch which
921 contains "files" whose paths are the object names for the objects
922 they describe, with some directory separators included for performance
923 reasons <span class="footnote"><br />[Permitted pathnames have the form
924 <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
925 names of two hexadecimal digits each followed by a filename with the
926 rest of the object ID.]<br /></span>.</p></div>
927 <div class="paragraph"><p>Every notes change creates a new commit at the specified notes ref.
928 You can therefore inspect the history of the notes by invoking, e.g.,
929 <tt>git log -p notes/commits</tt>. Currently the commit message only records
930 which operation triggered the update, and the commit authorship is
931 determined according to the usual rules (see <a href="git-commit.html">git-commit(1)</a>).
932 These details may change in the future.</p></div>
933 <div class="paragraph"><p>It is also permitted for a notes ref to point directly to a tree
934 object, in which case the history of the notes can be read with
935 <tt>git log -p -g &lt;refname&gt;</tt>.</p></div>
936 </div>
937 <h2 id="_notes_merge_strategies">NOTES MERGE STRATEGIES</h2>
938 <div class="sectionbody">
939 <div class="paragraph"><p>The default notes merge strategy is "manual", which checks out
940 conflicting notes in a special work tree for resolving notes conflicts
941 (<tt>.git/NOTES_MERGE_WORKTREE</tt>), and instructs the user to resolve the
942 conflicts in that work tree.
943 When done, the user can either finalize the merge with
944 <em>git notes merge --commit</em>, or abort the merge with
945 <em>git notes merge --abort</em>.</p></div>
946 <div class="paragraph"><p>"ours" automatically resolves conflicting notes in favor of the local
947 version (i.e. the current notes ref).</p></div>
948 <div class="paragraph"><p>"theirs" automatically resolves notes conflicts in favor of the remote
949 version (i.e. the given notes ref being merged into the current notes
950 ref).</p></div>
951 <div class="paragraph"><p>"union" automatically resolves notes conflicts by concatenating the
952 local and remote versions.</p></div>
953 <div class="paragraph"><p>"cat_sort_uniq" is similar to "union", but in addition to concatenating
954 the local and remote versions, this strategy also sorts the resulting
955 lines, and removes duplicate lines from the result. This is equivalent
956 to applying the "cat | sort | uniq" shell pipeline to the local and
957 remote versions. This strategy is useful if the notes follow a line-based
958 format where one wants to avoid duplicated lines in the merge result.
959 Note that if either the local or remote version contain duplicate lines
960 prior to the merge, these will also be removed by this notes merge
961 strategy.</p></div>
962 </div>
963 <h2 id="_examples">EXAMPLES</h2>
964 <div class="sectionbody">
965 <div class="paragraph"><p>You can use notes to add annotations with information that was not
966 available at the time a commit was written.</p></div>
967 <div class="listingblock">
968 <div class="content">
969 <pre><tt>$ git notes add -m 'Tested-by: Johannes Sixt &lt;j6t@kdbg.org&gt;' 72a144e2
970 $ git show -s 72a144e
971 [...]
972 Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
974 Notes:
975 Tested-by: Johannes Sixt &lt;j6t@kdbg.org&gt;</tt></pre>
976 </div></div>
977 <div class="paragraph"><p>In principle, a note is a regular Git blob, and any kind of
978 (non-)format is accepted. You can binary-safely create notes from
979 arbitrary files using <em>git hash-object</em>:</p></div>
980 <div class="listingblock">
981 <div class="content">
982 <pre><tt>$ cc *.c
983 $ blob=$(git hash-object -w a.out)
984 $ git notes --ref=built add -C "$blob" HEAD</tt></pre>
985 </div></div>
986 <div class="paragraph"><p>(You cannot simply use <tt>git notes --ref=built add -F a.out HEAD</tt>
987 because that is not binary-safe.)
988 Of course, it doesn&#8217;t make much sense to display non-text-format notes
989 with <em>git log</em>, so if you use such notes, you&#8217;ll probably need to write
990 some special-purpose tools to do something useful with them.</p></div>
991 </div>
992 <h2 id="_configuration">CONFIGURATION</h2>
993 <div class="sectionbody">
994 <div class="dlist"><dl>
995 <dt class="hdlist1">
996 core.notesRef
997 </dt>
998 <dd>
1000 Notes ref to read and manipulate instead of
1001 <tt>refs/notes/commits</tt>. Must be an unabbreviated ref name.
1002 This setting can be overridden through the environment and
1003 command line.
1004 </p>
1005 </dd>
1006 <dt class="hdlist1">
1007 notes.displayRef
1008 </dt>
1009 <dd>
1011 Which ref (or refs, if a glob or specified more than once), in
1012 addition to the default set by <tt>core.notesRef</tt> or
1013 <em>GIT_NOTES_REF</em>, to read notes from when showing commit
1014 messages with the <em>git log</em> family of commands.
1015 This setting can be overridden on the command line or by the
1016 <em>GIT_NOTES_DISPLAY_REF</em> environment variable.
1017 See <a href="git-log.html">git-log(1)</a>.
1018 </p>
1019 </dd>
1020 <dt class="hdlist1">
1021 notes.rewrite.&lt;command&gt;
1022 </dt>
1023 <dd>
1025 When rewriting commits with &lt;command&gt; (currently <tt>amend</tt> or
1026 <tt>rebase</tt>), if this variable is <tt>false</tt>, git will not copy
1027 notes from the original to the rewritten commit. Defaults to
1028 <tt>true</tt>. See also "<tt>notes.rewriteRef</tt>" below.
1029 </p>
1030 <div class="paragraph"><p>This setting can be overridden by the <em>GIT_NOTES_REWRITE_REF</em>
1031 environment variable.</p></div>
1032 </dd>
1033 <dt class="hdlist1">
1034 notes.rewriteMode
1035 </dt>
1036 <dd>
1038 When copying notes during a rewrite, what to do if the target
1039 commit already has a note. Must be one of <tt>overwrite</tt>,
1040 <tt>concatenate</tt>, and <tt>ignore</tt>. Defaults to <tt>concatenate</tt>.
1041 </p>
1042 <div class="paragraph"><p>This setting can be overridden with the <tt>GIT_NOTES_REWRITE_MODE</tt>
1043 environment variable.</p></div>
1044 </dd>
1045 <dt class="hdlist1">
1046 notes.rewriteRef
1047 </dt>
1048 <dd>
1050 When copying notes during a rewrite, specifies the (fully
1051 qualified) ref whose notes should be copied. May be a glob,
1052 in which case notes in all matching refs will be copied. You
1053 may also specify this configuration several times.
1054 </p>
1055 <div class="paragraph"><p>Does not have a default value; you must configure this variable to
1056 enable note rewriting.</p></div>
1057 <div class="paragraph"><p>Can be overridden with the <em>GIT_NOTES_REWRITE_REF</em> environment variable.</p></div>
1058 </dd>
1059 </dl></div>
1060 </div>
1061 <h2 id="_environment">ENVIRONMENT</h2>
1062 <div class="sectionbody">
1063 <div class="dlist"><dl>
1064 <dt class="hdlist1">
1065 <em>GIT_NOTES_REF</em>
1066 </dt>
1067 <dd>
1069 Which ref to manipulate notes from, instead of <tt>refs/notes/commits</tt>.
1070 This overrides the <tt>core.notesRef</tt> setting.
1071 </p>
1072 </dd>
1073 <dt class="hdlist1">
1074 <em>GIT_NOTES_DISPLAY_REF</em>
1075 </dt>
1076 <dd>
1078 Colon-delimited list of refs or globs indicating which refs,
1079 in addition to the default from <tt>core.notesRef</tt> or
1080 <em>GIT_NOTES_REF</em>, to read notes from when showing commit
1081 messages.
1082 This overrides the <tt>notes.displayRef</tt> setting.
1083 </p>
1084 <div class="paragraph"><p>A warning will be issued for refs that do not exist, but a glob that
1085 does not match any refs is silently ignored.</p></div>
1086 </dd>
1087 <dt class="hdlist1">
1088 <em>GIT_NOTES_REWRITE_MODE</em>
1089 </dt>
1090 <dd>
1092 When copying notes during a rewrite, what to do if the target
1093 commit already has a note.
1094 Must be one of <tt>overwrite</tt>, <tt>concatenate</tt>, and <tt>ignore</tt>.
1095 This overrides the <tt>core.rewriteMode</tt> setting.
1096 </p>
1097 </dd>
1098 <dt class="hdlist1">
1099 <em>GIT_NOTES_REWRITE_REF</em>
1100 </dt>
1101 <dd>
1103 When rewriting commits, which notes to copy from the original
1104 to the rewritten commit. Must be a colon-delimited list of
1105 refs or globs.
1106 </p>
1107 <div class="paragraph"><p>If not set in the environment, the list of notes to copy depends
1108 on the <tt>notes.rewrite.&lt;command&gt;</tt> and <tt>notes.rewriteRef</tt> settings.</p></div>
1109 </dd>
1110 </dl></div>
1111 </div>
1112 <h2 id="_author">Author</h2>
1113 <div class="sectionbody">
1114 <div class="paragraph"><p>Written by Johannes Schindelin &lt;<a href="mailto:johannes.schindelin@gmx.de">johannes.schindelin@gmx.de</a>&gt; and
1115 Johan Herland &lt;<a href="mailto:johan@herland.net">johan@herland.net</a>&gt;</p></div>
1116 </div>
1117 <h2 id="_documentation">Documentation</h2>
1118 <div class="sectionbody">
1119 <div class="paragraph"><p>Documentation by Johannes Schindelin and Johan Herland</p></div>
1120 </div>
1121 <h2 id="_git">GIT</h2>
1122 <div class="sectionbody">
1123 <div class="paragraph"><p>Part of the <a href="git.html">git(7)</a> suite</p></div>
1124 </div>
1125 </div>
1126 <div id="footnotes"><hr /></div>
1127 <div id="footer">
1128 <div id="footer-text">
1129 Last updated 2011-09-21 23:01:14 PDT
1130 </div>
1131 </div>
1132 </body>
1133 </html>