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

git-note -C changes commit type?

From
Joachim Breitner <mail@joachim-breitner.de>
Date
Feb 11, 2014, 17:23 UTC
Message-ID
<1392139407.12790.7.camel@kirk>
Hi,

judging from the documentation I got the impression that I can pass any git object has to "git note -C <hash>" and it would stored as-is. But it seems the objects gets mangled somehow...

(I want to attach a commit object as a note, to reference the history of a feature before the final cleanup rebase. For that I turn the reflog into a series of commits, and the final commit is the one I want to store there.)

$ mkdir foo
$ cd foo/
$ echo foo > a
$ git init
Initialisierte leeres Git-Repository in /tmp/foo/.git/
$ git add a
$ git commit -m 'A commit'
[master (Basis-Commit) 3d7de37] A commit
 1 file changed, 1 insertion(+)
 create mode 100644 a
$ echo foo2 > a
$ git commit -m 'A commit 2' -a
[master e1bfac4] A commit 2
 1 file changed, 1 insertion(+), 1 deletion(-)
$ git notes --ref history add -C 3d7de37 e1bfac4
$ git ls-tree notes/history
100644 blob 5b73d5152e6207e3a2b67e57ca3a2cb94d12061e e1bfac434ebd3135a3784f6fc802f235098eebd0
I was expecting 3d7de37 to be referenced here.
Is that a bug, or is storing commits as notes not supported?

Thanks, Joachim

-- 
Joachim “nomeata” Breitner
  mail@joachim-breitner.de • http://www.joachim-breitner.de/
  Jabber: nomeata@joachim-breitner.de  • GPG-Key: 0x4743206C
  Debian Developer: nomeata@debian.org
Next: Johan Herland
Message 1 of 11 in “git-note -C changes commit type?”
  1. Joachim BreitnerFeb 11, 2014
  2. Johan HerlandFeb 11, 2014
  3. Junio C HamanoFeb 12, 2014
  4. Kyle J. McKayFeb 12, 2014
  5. Johan HerlandFeb 12, 2014
  6. notes: Disallow reusing non-blob as a note objectJohan Herland, Feb 12, 2014
  7. Eric SunshineFeb 14, 2014
  8. Junio C HamanoFeb 14, 2014
  9. Joachim BreitnerFeb 12, 2014
  10. Johan HerlandFeb 12, 2014
  11. Joachim BreitnerFeb 12, 2014

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.