{"thread":{"id":"34725","subject":"Notes and submodules","startedAt":"2013-08-19T08:13:34Z","lastAt":"2013-08-20T09:41:37Z","messageCount":4,"participants":["Francis Moreau","Johan Herland"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"225446","messageId":"CAC9WiBj-ij1o6JL-FtUuCgdf8ZqrhJb2=dQcSXjRMEwwL4VWFA@mail.gmail.com","threadId":"34725","inReplyTo":null,"subject":"Notes and submodules","fromName":"Francis Moreau","fromEmail":"francis.moro@gmail.com","sentAt":"2013-08-19T08:13:34Z","receivedAt":"2013-08-19T08:13:34Z","isPatch":false,"sender":{"key":"francis.moro@gmail.com","avatar":null},"body":"Hello,\n\nIs it possible to keep submodules notes in the super project  ?\n\nThanks\n-- \nFrancis\n"},{"id":"225457","messageId":"CALKQrgfGUMrcR+EPTvN9+mFPcW6Q-zv1JM6MJK-61BvF3yYpbQ@mail.gmail.com","threadId":"34725","inReplyTo":"CAC9WiBj-ij1o6JL-FtUuCgdf8ZqrhJb2=dQcSXjRMEwwL4VWFA@mail.gmail.com","subject":"Re: Notes and submodules","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2013-08-19T13:55:56Z","receivedAt":"2013-08-19T13:55:56Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Mon, Aug 19, 2013 at 10:13 AM, Francis Moreau <francis.moro@gmail.com> wrote:\n> Hello,\n>\n> Is it possible to keep submodules notes in the super project  ?\n\nNot easily. I guess it depends on what you want to use the notes for.\nIn order for notes to be generally useful (i.e. show up in logs,\nsurviving a notes prune, etc.) they really must reside in the same\nrepo as the annotated objects [1]. Now, if all your interaction with\nnotes happens through scripts that you control, then I guess it would\nbe possible to hack this in some sort of semi-workable way, but you\nwould still have to make sure never to run \"git notes prune\" in the\nsuper project. I guess the real question here is: Why would you want\nto do this? and is there maybe some other way your use case can be\naccomodated?\n\n...Johan\n\n[1]: If you were to annotate objects in a submodule, but then store\nthe notes objects in the super project, it would be impossible for\n\"git log\" in the submodule to find the notes objects, and your log\nwould show no notes. Similarly, a \"git log\" in the super project would\nsee a lot of notes objects pointing to non-existing objects (because\nthose objects live in the submodule), hence the notes objects would be\nremoved when running \"git notes prune\" in the super project.\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"225501","messageId":"CAC9WiBiJQ-kafY5xD9nAnxKPQTyhp5sL49szHQj4C4P_UbBmYg@mail.gmail.com","threadId":"34725","inReplyTo":"CALKQrgfGUMrcR+EPTvN9+mFPcW6Q-zv1JM6MJK-61BvF3yYpbQ@mail.gmail.com","subject":"Re: Notes and submodules","fromName":"Francis Moreau","fromEmail":"francis.moro@gmail.com","sentAt":"2013-08-20T08:39:10Z","receivedAt":"2013-08-20T08:39:10Z","isPatch":false,"sender":{"key":"francis.moro@gmail.com","avatar":null},"body":"Hello,\n\nOn Mon, Aug 19, 2013 at 3:55 PM, Johan Herland <johan@herland.net> wrote:\n> On Mon, Aug 19, 2013 at 10:13 AM, Francis Moreau <francis.moro@gmail.com> wrote:\n>> Hello,\n>>\n>> Is it possible to keep submodules notes in the super project  ?\n>\n> Not easily. I guess it depends on what you want to use the notes for.\n> In order for notes to be generally useful (i.e. show up in logs,\n> surviving a notes prune, etc.) they really must reside in the same\n> repo as the annotated objects [1]. Now, if all your interaction with\n> notes happens through scripts that you control, then I guess it would\n> be possible to hack this in some sort of semi-workable way, but you\n> would still have to make sure never to run \"git notes prune\" in the\n> super project. I guess the real question here is: Why would you want\n> to do this? and is there maybe some other way your use case can be\n> accomodated?\n>\n\nWell, I'm tracking different foreign git repositories as submodules.\nThose repositories which tracks different projects are not mine\ntherefore I can't save my own stuff directly in them. I need to\nannotate some commits in each submodule.\n\nOne option would be to clone each repository in my own place, but I\nthough it would be simpler if I could store the anntotion in _my_\nsuper project.\n\nThanks for your time.\n-- \nFrancis\n"},{"id":"225504","messageId":"CALKQrgeWtZGYRGDxVy9kDUqGjMcFn8E3My3dR_9-Qyzuy6QMxw@mail.gmail.com","threadId":"34725","inReplyTo":"CAC9WiBiJQ-kafY5xD9nAnxKPQTyhp5sL49szHQj4C4P_UbBmYg@mail.gmail.com","subject":"Re: Notes and submodules","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2013-08-20T09:41:37Z","receivedAt":"2013-08-20T09:41:37Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Tue, Aug 20, 2013 at 10:39 AM, Francis Moreau <francis.moro@gmail.com> wrote:\n>> On Mon, Aug 19, 2013 at 3:55 PM, Johan Herland <johan@herland.net> wrote:\n>> On Mon, Aug 19, 2013 at 10:13 AM, Francis Moreau <francis.moro@gmail.com> wrote:\n>>> Is it possible to keep submodules notes in the super project  ?\n>>\n>> Not easily. I guess it depends on what you want to use the notes for.\n>> In order for notes to be generally useful (i.e. show up in logs,\n>> surviving a notes prune, etc.) they really must reside in the same\n>> repo as the annotated objects [1]. Now, if all your interaction with\n>> notes happens through scripts that you control, then I guess it would\n>> be possible to hack this in some sort of semi-workable way, but you\n>> would still have to make sure never to run \"git notes prune\" in the\n>> super project. I guess the real question here is: Why would you want\n>> to do this? and is there maybe some other way your use case can be\n>> accomodated?\n>\n> Well, I'm tracking different foreign git repositories as submodules.\n> Those repositories which tracks different projects are not mine\n> therefore I can't save my own stuff directly in them.\n\nSure you can. It's your clone, you can store whatever you want in\nthere, regardless of whether you are allowed to push your additions\nback to the foreign repo. You can always set up another remote repo\n(e.g. on GitHub) where you can push your additions (whether they be\nnotes or other Git objects).\n\n> I need to\n> annotate some commits in each submodule.\n>\n> One option would be to clone each repository in my own place, but I\n> though it would be simpler if I could store the anntotion in _my_\n> super project.\n\nNo, it's probably much more straightforward to simply maintain your\nown clones/forks of each submodule, and keep the annotations directly\nin there.\n\nIn Git, there is no real concept of _ownership_ of a project. I might\nput a repo on a server somewhere, and I can \"own\" that repo in that I\ncontrol who is allowed to push into it, but anybody that can read that\nrepo, can also clone it, and I have no say in what happens inside\nthose clones. If somebody is not happy with how I control/maintain the\nproject, they can make their own clone/fork available online, and\nconvince everybody to use that repo (instead of my repo) as the\nauthoritative source of the project.\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"}]}