buchuki/gitifyhg — pull request #24 by fingolfin (2013-01-25 22:41:38+00:00)
Title: Add some simple notes support

This is a very early proof-of-concept work of adding notes support, see the discussion on issue #4. This should NOT be merged, as there are multiple issues with it. Partly because things are not implemented yet, partly because I do not yet fully understand how git notes work. Here are some things that need to be done.

* It only adds notes when importing new commits; if you add commits in git, then ```git push``` no note is added to the git commit, not even when you ```git pull``` again.

* Actually, it won't work after the initial import either; if there are new commits made on the hg side then this happens:
```
$ git pull
warning: Not updating refs/notes/hg (new tip SOME_SHA does not contain OTHER_SHA)
fatal: Error while running fast-import
$
```
This is because notes are managed in commits, and the commits my hack generates do not bother to specify the correct parent commit. They really should. (I am somewhat surprised that cloning a repo with more than one commit works with this hack... clearly there is more I am not understanding).

* What should be used as the committer and commit message for these not commits? I guess the committer could be something like "gitifyhg ", the message could be empty or contain information about the import (e.g. when it happened, which revisions where imported, the weather forecast...)

* If I understand correctly how notes work, then we can have multiple notemodify messages in a single notes commit there. So instead of adding each note in its own "commit", we should just add all notes at once in a single commit to refs/notes/hg.

* I am sure there are more problems. But at least now we (well, at least I, not sure how helpful my rambling are :-) have a slightly better idea of what needs to be done.