From: Johan Herland <johan@herland.net>
To: Arnaud Lacurie <arnaud.lacurie@gmail.com>
Cc: git@vger.kernel.org, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
Sylvain Boulme <sylvain.boulme@imag.fr>
Subject: Re: Notes in fast import stream.
Date: Sun, 29 May 2011 22:20:40 +0200 [thread overview]
Message-ID: <201105292220.41322.johan@herland.net> (raw)
In-Reply-To: <BANLkTinpQ6HbTdNF8K5N0D3aYugj591LRw@mail.gmail.com>
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
next prev parent reply other threads:[~2011-05-29 20:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-29 15:52 Notes in fast import stream Arnaud Lacurie
2011-05-29 20:20 ` Johan Herland [this message]
2011-05-29 21:10 ` Arnaud Lacurie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201105292220.41322.johan@herland.net \
--to=johan@herland.net \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=arnaud.lacurie@gmail.com \
--cc=git@vger.kernel.org \
--cc=sylvain.boulme@imag.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).