Re: Notes in fast import stream.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sunday 29 May 2011, Arnaud Lacurie wrote:
> Hi,
> 
> I would like to add notes through a fast-import stream.
> The problem is that I can't know the SHA1 of the commit I would like
> to add a note to before the fast-import is done.
> I would like to use marks to link my note to a commit this way :
> 
> 
> commit refs/heads/master";
> mark :1
> committer user <user@xxxxxxxxxxx> GMT+0000
> data length_of_my_comment
> my_comment
> M 644 inline my_file
> data length_of_my_file
> my_file_content
> N inline :1
> data my_note_length
> my_note_content
> 
> This doesn't work because the mark 1 declaration is not finished, and
> I can't bind a note to it yet.
> 
> How could I do then ?

First, you should realize that even though the notes are "conceptually" tied 
to a commit (or any other type of Git object), the note objects are 
_technically_ independent from the annotated objects. In fact, the note 
objects live on a separate ref with a wholly separate history. In other 
words, it does not make sense to define the note in the very same 'commit' 
command that you're trying to annotate. Instead, you should organize it 
something like this:


commit refs/heads/master
mark :1
committer user <user@xxxxxxxxxxx> GMT+0000
data length_of_my_comment
my_comment
M 644 inline my_file
data length_of_my_file
my_file_content

commit refs/notes/commits
committer user <user@xxxxxxxxxxx> GMT+0000
data length_of_dummy_comment
dummy_comment
N inline :1
data my_note_length
my_note_content


(Obviously, you can add notes for several commits in a single "commit 
refs/notes/commits" command).


Hope this helps,

...Johan

-- 
Johan Herland, <johan@xxxxxxxxxxx>
www.herland.net
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]