{"thread":{"id":"27496","subject":"Notes in fast import stream.","startedAt":"2011-05-29T15:52:06Z","lastAt":"2011-05-29T21:10:48Z","messageCount":3,"participants":["Arnaud Lacurie","Johan Herland"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"168943","messageId":"BANLkTinpQ6HbTdNF8K5N0D3aYugj591LRw@mail.gmail.com","threadId":"27496","inReplyTo":null,"subject":"Notes in fast import stream.","fromName":"Arnaud Lacurie","fromEmail":"arnaud.lacurie@gmail.com","sentAt":"2011-05-29T15:52:06Z","receivedAt":"2011-05-29T15:52:06Z","isPatch":false,"sender":{"key":"arnaud.lacurie@gmail.com","avatar":null},"body":"Hi,\n\nI would like to add notes through a fast-import stream.\nThe problem is that I can't know the SHA1 of the commit I would like\nto add a note to before the fast-import is done.\nI would like to use marks to link my note to a commit this way :\n\n\ncommit refs/heads/master\";\nmark :1\ncommitter user <user@example.com> GMT+0000\ndata length_of_my_comment\nmy_comment\nM 644 inline my_file\ndata length_of_my_file\nmy_file_content\nN inline :1\ndata my_note_length\nmy_note_content\n\nThis doesn't work because the mark 1 declaration is not finished, and\nI can't bind a note to it yet.\n\nHow could I do then ?\n\nThanks for you help.\n\n\n-- \nArnaud Lacurie\n"},{"id":"168952","messageId":"201105292220.41322.johan@herland.net","threadId":"27496","inReplyTo":"BANLkTinpQ6HbTdNF8K5N0D3aYugj591LRw@mail.gmail.com","subject":"Re: Notes in fast import stream.","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2011-05-29T20:20:40Z","receivedAt":"2011-05-29T20:20:40Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Sunday 29 May 2011, Arnaud Lacurie wrote:\n> Hi,\n> \n> I would like to add notes through a fast-import stream.\n> The problem is that I can't know the SHA1 of the commit I would like\n> to add a note to before the fast-import is done.\n> I would like to use marks to link my note to a commit this way :\n> \n> \n> commit refs/heads/master\";\n> mark :1\n> committer user <user@example.com> GMT+0000\n> data length_of_my_comment\n> my_comment\n> M 644 inline my_file\n> data length_of_my_file\n> my_file_content\n> N inline :1\n> data my_note_length\n> my_note_content\n> \n> This doesn't work because the mark 1 declaration is not finished, and\n> I can't bind a note to it yet.\n> \n> How could I do then ?\n\nFirst, you should realize that even though the notes are \"conceptually\" tied \nto a commit (or any other type of Git object), the note objects are \n_technically_ independent from the annotated objects. In fact, the note \nobjects live on a separate ref with a wholly separate history. In other \nwords, it does not make sense to define the note in the very same 'commit' \ncommand that you're trying to annotate. Instead, you should organize it \nsomething like this:\n\n\ncommit refs/heads/master\nmark :1\ncommitter user <user@example.com> GMT+0000\ndata length_of_my_comment\nmy_comment\nM 644 inline my_file\ndata length_of_my_file\nmy_file_content\n\ncommit refs/notes/commits\ncommitter user <user@example.com> GMT+0000\ndata length_of_dummy_comment\ndummy_comment\nN inline :1\ndata my_note_length\nmy_note_content\n\n\n(Obviously, you can add notes for several commits in a single \"commit \nrefs/notes/commits\" command).\n\n\nHope this helps,\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"168957","messageId":"BANLkTimxULgUMtLDqihbuP3CeURC6o=hWA@mail.gmail.com","threadId":"27496","inReplyTo":"201105292220.41322.johan@herland.net","subject":"Re: Notes in fast import stream.","fromName":"Arnaud Lacurie","fromEmail":"arnaud.lacurie@gmail.com","sentAt":"2011-05-29T21:10:48Z","receivedAt":"2011-05-29T21:10:48Z","isPatch":false,"sender":{"key":"arnaud.lacurie@gmail.com","avatar":null},"body":"It works perfectly !  I haden't understood it that way.\n\nThank you very much for your help !\n\n-- \nArnaud Lacurie\n"}]}