summaryrefslogtreecommitdiff
path: root/Documentation/git-notes.txt
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-05-08 22:21:34 -0500
committerJunio C Hamano <gitster@pobox.com>2010-05-08 22:30:02 -0700
commit8d6888ec6aee97f8b2b395e7e075dd00d9689c25 (patch)
treed6511d9df9a552d8cb7008fb7931a2ed53b0834d /Documentation/git-notes.txt
parent9eb3f816dea9fa00e7c20204516b0cb288219057 (diff)
downloadgit-8d6888ec6aee97f8b2b395e7e075dd00d9689c25.tar.gz
Documentation/notes: describe content of notes blobs
stripspace/text-based formatting kicks in when specifying the notes content with -m or -F, or when an editor is used to edit the notes. To binary-safely create notes from files, the following construct is required: git notes add -C $(git hash-object -w <file>) <object> Explain this trick (thanks, Johan!) in the manual. Add an ordinary example, too, to keep this esoteric one company. Cc: Johan Herland <johan@herland.net> Cc: Thomas Rast <trast@student.ethz.ch> Cc: Jeff King <peff@peff.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-notes.txt')
-rw-r--r--Documentation/git-notes.txt38
1 files changed, 37 insertions, 1 deletions
diff --git a/Documentation/git-notes.txt b/Documentation/git-notes.txt
index af12c3c9e7..97b9d81e29 100644
--- a/Documentation/git-notes.txt
+++ b/Documentation/git-notes.txt
@@ -101,15 +101,20 @@ OPTIONS
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.
-F <file>::
--file=<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.
-C <object>::
--reuse-message=<object>::
- Reuse the note message from the given note object.
+ Take the note message from the given blob object (for
+ example, another note).
-c <object>::
--reedit-message=<object>::
@@ -147,6 +152,37 @@ object, in which case the history of the notes can be read with
`git log -p -g <refname>`.
+EXAMPLES
+--------
+
+You can use notes to add annotations with information that was not
+available at the time a commit was written.
+
+------------
+$ git notes add -m 'Tested-by: Johannes Sixt <j6t@kdbg.org>' 72a144e2
+$ git show -s 72a144e
+[...]
+ Signed-off-by: Junio C Hamano <gitster@pobox.com>
+
+Notes:
+ Tested-by: Johannes Sixt <j6t@kdbg.org>
+------------
+
+In principle, a note is a regular Git blob, and any kind of
+(non-)format is accepted. You can binary-safely create notes from
+arbitrary files using 'git hash-object':
+
+------------
+$ cc *.c
+$ blob=$(git hash-object -w a.out)
+$ git notes --ref=built add -C "$blob" HEAD
+------------
+
+Of course, it doesn't make much sense to display non-text-format notes
+with 'git log', so if you use such notes, you'll probably need to write
+some special-purpose tools to do something useful with them.
+
+
Author
------
Written by Johannes Schindelin <johannes.schindelin@gmx.de> and