{"thread":{"id":"37532","subject":"[PATCH] git-notes.txt: Explain how to transfer notes between repos","startedAt":"2014-09-10T13:56:54Z","lastAt":"2014-09-10T23:31:54Z","messageCount":3,"participants":["Øyvind A. Holm","Eric Sunshine","Johan Herland"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"249131","messageId":"1410357414-691-1-git-send-email-sunny@sunbase.org","threadId":"37532","inReplyTo":null,"subject":"[PATCH] git-notes.txt: Explain how to transfer notes between repos","fromName":"Øyvind A. Holm","fromEmail":"sunny@sunbase.org","sentAt":"2014-09-10T13:56:54Z","receivedAt":"2014-09-10T13:56:54Z","isPatch":true,"sender":{"key":"sunny@sunbase.org","avatar":"https://avatars.githubusercontent.com/u/113445?v=4"},"body":"The documentation for git notes did not mention anywhere how to transfer\nnotes between repositories, create a section that explains this topic.\n\nSigned-off-by: Øyvind A. Holm <sunny@sunbase.org>\n---\n Documentation/git-notes.txt | 39 +++++++++++++++++++++++++++++++++++++++\n 1 file changed, 39 insertions(+)\n\ndiff --git a/Documentation/git-notes.txt b/Documentation/git-notes.txt\nindex 310f0a5..4237bec 100644\n--- a/Documentation/git-notes.txt\n+++ b/Documentation/git-notes.txt\n@@ -264,6 +264,45 @@ prior to the merge, these will also be removed by this notes merge\n strategy.\n \n \n+TRANSFERRING NOTES ACROSS REPOSITORIES\n+--------------------------------------\n+\n+Notes are not transferred by default when using the standard\n+fetch/push commands, but has be done explicitly. To fetch all notes\n+from a particular remote, use\n+\n+------------\n+$ git fetch origin refs/notes/*:refs/notes/*\n+------------\n+\n+`git fetch` can be configured to automatically fetch notes from a\n+remote with this command:\n+\n+------------\n+$ git config --add remote.origin.fetch +refs/notes/*:refs/notes/*\n+------------\n+\n+To transfer notes to a remote repository:\n+\n+------------\n+$ git push origin refs/notes/*\n+------------\n+\n+If you don't want to fetch or push all notes stored under\n+`refs/notes/`, replace the asterisk with the specific type of notes\n+you want to transfer:\n+\n+------------\n+$ git fetch origin refs/notes/commits:refs/notes/commits\n+------------\n+\n+or\n+\n+------------\n+$ git push origin refs/notes/commits\n+------------\n+\n+\n EXAMPLES\n --------\n \n-- \n2.1.0.127.g0c72b98\n"},{"id":"249146","messageId":"CAPig+cQeJz2DZ+=qdAM-grOC=kQ+DSTL8gsycyq8djrGoaPVJg@mail.gmail.com","threadId":"37532","inReplyTo":"1410357414-691-1-git-send-email-sunny@sunbase.org","subject":"Re: [PATCH] git-notes.txt: Explain how to transfer notes between repos","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2014-09-10T19:59:00Z","receivedAt":"2014-09-10T19:59:00Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Wed, Sep 10, 2014 at 9:56 AM, Øyvind A. Holm <sunny@sunbase.org> wrote:\n> The documentation for git notes did not mention anywhere how to transfer\n> notes between repositories, create a section that explains this topic.\n>\n> Signed-off-by: Øyvind A. Holm <sunny@sunbase.org>\n> ---\n> diff --git a/Documentation/git-notes.txt b/Documentation/git-notes.txt\n> index 310f0a5..4237bec 100644\n> --- a/Documentation/git-notes.txt\n> +++ b/Documentation/git-notes.txt\n> @@ -264,6 +264,45 @@ prior to the merge, these will also be removed by this notes merge\n>  strategy.\n>\n>\n> +TRANSFERRING NOTES ACROSS REPOSITORIES\n> +--------------------------------------\n> +\n> +Notes are not transferred by default when using the standard\n> +fetch/push commands, but has be done explicitly. To fetch all notes\n\nAt minimum: s/has be/has to be/\n\nSlightly improved phrasing, perhaps:\n\n    Notes are not transferred, by default, when using the standard\n    fetch/push commands, thus must be transferred explicitly.\n\n> +from a particular remote, use\n\ns/use/use:/\n\n> +------------\n> +$ git fetch origin refs/notes/*:refs/notes/*\n> +------------\n> +\n> +`git fetch` can be configured to automatically fetch notes from a\n> +remote with this command:\n> +\n> +------------\n> +$ git config --add remote.origin.fetch +refs/notes/*:refs/notes/*\n> +------------\n> +\n> +To transfer notes to a remote repository:\n> +\n> +------------\n> +$ git push origin refs/notes/*\n> +------------\n> +\n> +If you don't want to fetch or push all notes stored under\n> +`refs/notes/`, replace the asterisk with the specific type of notes\n> +you want to transfer:\n> +\n> +------------\n> +$ git fetch origin refs/notes/commits:refs/notes/commits\n> +------------\n> +\n> +or\n> +\n> +------------\n> +$ git push origin refs/notes/commits\n> +------------\n> +\n> +\n>  EXAMPLES\n>  --------\n>\n> --\n> 2.1.0.127.g0c72b98\n"},{"id":"249193","messageId":"CALKQrgfQ4-A=NgR_gSsaSXMjRzQZtXBdvrWbzTBGH3jyfC4bJg@mail.gmail.com","threadId":"37532","inReplyTo":"1410357414-691-1-git-send-email-sunny@sunbase.org","subject":"Re: [PATCH] git-notes.txt: Explain how to transfer notes between repos","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2014-09-10T23:31:54Z","receivedAt":"2014-09-10T23:31:54Z","isPatch":true,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Wed, Sep 10, 2014 at 3:56 PM, Øyvind A. Holm <sunny@sunbase.org> wrote:\n> The documentation for git notes did not mention anywhere how to transfer\n> notes between repositories, create a section that explains this topic.\n\nThanks! Although there are some online resource containing similar\ninformation (e.g. http://git-scm.com/blog/2010/08/25/notes.html), this\ninfo has obviously been missing from the manual page for way too long.\n\nYour text illustrates well how to work with simple notes sharing\nscenarios, where there are typically only a single writer per notes\nref. However, if you have a situation where you and your peers are\ncontributing to the same notes refs, then you will need a more\nsophisticated scheme.\n\nIn your current illustration, if you do some notes work on\nrefs/notes/foo, and your friend does the same, then, when you fetch\nfrom your friend (with the +refs/notes/*:refs/notes/* refspec\nconfigured), their notes work will silently overwrite your own notes\nwork (the '+' in the refspec causes a \"forced update\"). What you\ntypically would want instead, is to fetch your friend's notes refs\ninto a separate namespace (similar to how git stores remote branches\nunder refs/remotes/$remote/* instead of directly under refs/heads/*),\nso that you can examine their changes before potentially merging them\nwith your own (using 'git notes merge').\n\nThis is a more complicated workflow than the one you sketch out below,\nand although it's only really needed for notes ref with multiple\nwriters, I believe that is such a common use case that it merits at\nleast a mention in the manual page. I'm not sure if we would need to\nsketch out the entire workflow, or whether it's sufficient to merely\nmention that a more complicated workflow is needed in the multi-writer\ncase.\n\n\nHave fun! :)\n\n...Johan\n\n> Signed-off-by: Øyvind A. Holm <sunny@sunbase.org>\n> ---\n>  Documentation/git-notes.txt | 39 +++++++++++++++++++++++++++++++++++++++\n>  1 file changed, 39 insertions(+)\n>\n> diff --git a/Documentation/git-notes.txt b/Documentation/git-notes.txt\n> index 310f0a5..4237bec 100644\n> --- a/Documentation/git-notes.txt\n> +++ b/Documentation/git-notes.txt\n> @@ -264,6 +264,45 @@ prior to the merge, these will also be removed by this notes merge\n>  strategy.\n>\n>\n> +TRANSFERRING NOTES ACROSS REPOSITORIES\n> +--------------------------------------\n> +\n> +Notes are not transferred by default when using the standard\n> +fetch/push commands, but has be done explicitly. To fetch all notes\n> +from a particular remote, use\n> +\n> +------------\n> +$ git fetch origin refs/notes/*:refs/notes/*\n> +------------\n> +\n> +`git fetch` can be configured to automatically fetch notes from a\n> +remote with this command:\n> +\n> +------------\n> +$ git config --add remote.origin.fetch +refs/notes/*:refs/notes/*\n> +------------\n> +\n> +To transfer notes to a remote repository:\n> +\n> +------------\n> +$ git push origin refs/notes/*\n> +------------\n> +\n> +If you don't want to fetch or push all notes stored under\n> +`refs/notes/`, replace the asterisk with the specific type of notes\n> +you want to transfer:\n> +\n> +------------\n> +$ git fetch origin refs/notes/commits:refs/notes/commits\n> +------------\n> +\n> +or\n> +\n> +------------\n> +$ git push origin refs/notes/commits\n> +------------\n> +\n> +\n>  EXAMPLES\n>  --------\n>\n> --\n> 2.1.0.127.g0c72b98\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n\n\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"}]}