git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-notes.txt: clarify -C vs. copy and -F

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Aug 25, 2011, 10:26 UTC
Message-ID
<0b124a705cf63d7c531a3a097a158dbaeaf6d298.1314267281.git.git@drmicha.warpmail.net>
In-Reply-To
<7v1v1pr97x.fsf@alter.siamese.dyndns.org>

The current description of '-C' together with the analogy to 'git commit -C' can lead to the wrong conclusion that '-C' copies notes between objects. Make this clearer by rewording and pointing to 'copy'.

The example for attaching binary notes with 'git hash-object' followed by 'git notes add -C' immediately raises the question: "Why not use 'git notes add -F'?". Answer it (the latter is not binary-safe).

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
This one has been lying around and fell under the rugs of the discussion
for a ui redesign which never happened. So I think it's still worth it.
---
 Documentation/git-notes.txt |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-notes.txt b/Documentation/git-notes.txt
index 6a187f2..e8319ea 100644
--- a/Documentation/git-notes.txt
+++ b/Documentation/git-notes.txt
@@ -142,8 +142,9 @@ OPTIONS
 
 -C <object>::
 --reuse-message=<object>::
-	Take the note message from the given blob object (for
-	example, another note).
+	Take the given blob object (for	example, another note) as the
+	note message. (Use `git notes copy <object>` instead to
+	copy notes between objects.)
 
 -c <object>::
 --reedit-message=<object>::
@@ -285,6 +286,8 @@ $ blob=$(git hash-object -w a.out)
 $ git notes --ref=built add -C "$blob" HEAD
 ------------
 
+(You cannot simply use `git notes --ref=built add -F a.out HEAD`
+because that is not binary-safe.)
 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.
-- 
1.7.6.845.gc3c05
Previous: Junio C HamanoNext: Johan Herland
Message 8 of 15 in “git-notes.txt: clarify -C vs. copy and -F”
  1. git-notes.txt: clarify -C vs. copy and -FMichael J Gruber, Mar 29, 2011
  2. Johan HerlandMar 29, 2011
  3. Junio C HamanoMar 29, 2011
  4. Junio C HamanoMar 29, 2011
  5. Michael J GruberMar 29, 2011
  6. Junio C HamanoMar 29, 2011
  7. Junio C HamanoMar 29, 2011
  8. git-notes.txt: clarify -C vs. copy and -FMichael J Gruber, Aug 25, 2011
  9. Johan HerlandAug 25, 2011
  10. Make "git notes add" more user-friendly when there are existing notesJohan Herland, Mar 30, 2011
  11. Michael J GruberMar 30, 2011
  12. Johan HerlandMar 30, 2011
  13. Lasse MakholmApr 4, 2011
  14. Michael J GruberApr 4, 2011
  15. Junio C HamanoMar 30, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.