git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Notes in fast import stream.
@ 2011-05-29 15:52 Arnaud Lacurie
  2011-05-29 20:20 ` Johan Herland
  0 siblings, 1 reply; 3+ messages in thread
From: Arnaud Lacurie @ 2011-05-29 15:52 UTC (permalink / raw)
  To: git; +Cc: Matthieu Moy, Sylvain Boulme

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@example.com> 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 ?

Thanks for you help.


-- 
Arnaud Lacurie

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Notes in fast import stream.
  2011-05-29 15:52 Notes in fast import stream Arnaud Lacurie
@ 2011-05-29 20:20 ` Johan Herland
  2011-05-29 21:10   ` Arnaud Lacurie
  0 siblings, 1 reply; 3+ messages in thread
From: Johan Herland @ 2011-05-29 20:20 UTC (permalink / raw)
  To: Arnaud Lacurie; +Cc: git, Matthieu Moy, Sylvain Boulme

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@example.com> 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@example.com> 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@example.com> 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@herland.net>
www.herland.net

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Notes in fast import stream.
  2011-05-29 20:20 ` Johan Herland
@ 2011-05-29 21:10   ` Arnaud Lacurie
  0 siblings, 0 replies; 3+ messages in thread
From: Arnaud Lacurie @ 2011-05-29 21:10 UTC (permalink / raw)
  To: Johan Herland; +Cc: git, Matthieu Moy, Sylvain Boulme

It works perfectly !  I haden't understood it that way.

Thank you very much for your help !

-- 
Arnaud Lacurie

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-29 21:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-29 15:52 Notes in fast import stream Arnaud Lacurie
2011-05-29 20:20 ` Johan Herland
2011-05-29 21:10   ` Arnaud Lacurie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).