git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Notes and submodules
@ 2013-08-19  8:13 Francis Moreau
  2013-08-19 13:55 ` Johan Herland
  0 siblings, 1 reply; 4+ messages in thread
From: Francis Moreau @ 2013-08-19  8:13 UTC (permalink / raw)
  To: git@vger.kernel.org

Hello,

Is it possible to keep submodules notes in the super project  ?

Thanks
-- 
Francis

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

* Re: Notes and submodules
  2013-08-19  8:13 Notes and submodules Francis Moreau
@ 2013-08-19 13:55 ` Johan Herland
  2013-08-20  8:39   ` Francis Moreau
  0 siblings, 1 reply; 4+ messages in thread
From: Johan Herland @ 2013-08-19 13:55 UTC (permalink / raw)
  To: Francis Moreau; +Cc: git@vger.kernel.org

On Mon, Aug 19, 2013 at 10:13 AM, Francis Moreau <francis.moro@gmail.com> wrote:
> Hello,
>
> Is it possible to keep submodules notes in the super project  ?

Not easily. I guess it depends on what you want to use the notes for.
In order for notes to be generally useful (i.e. show up in logs,
surviving a notes prune, etc.) they really must reside in the same
repo as the annotated objects [1]. Now, if all your interaction with
notes happens through scripts that you control, then I guess it would
be possible to hack this in some sort of semi-workable way, but you
would still have to make sure never to run "git notes prune" in the
super project. I guess the real question here is: Why would you want
to do this? and is there maybe some other way your use case can be
accomodated?

...Johan

[1]: If you were to annotate objects in a submodule, but then store
the notes objects in the super project, it would be impossible for
"git log" in the submodule to find the notes objects, and your log
would show no notes. Similarly, a "git log" in the super project would
see a lot of notes objects pointing to non-existing objects (because
those objects live in the submodule), hence the notes objects would be
removed when running "git notes prune" in the super project.

-- 
Johan Herland, <johan@herland.net>
www.herland.net

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

* Re: Notes and submodules
  2013-08-19 13:55 ` Johan Herland
@ 2013-08-20  8:39   ` Francis Moreau
  2013-08-20  9:41     ` Johan Herland
  0 siblings, 1 reply; 4+ messages in thread
From: Francis Moreau @ 2013-08-20  8:39 UTC (permalink / raw)
  To: Johan Herland; +Cc: git@vger.kernel.org

Hello,

On Mon, Aug 19, 2013 at 3:55 PM, Johan Herland <johan@herland.net> wrote:
> On Mon, Aug 19, 2013 at 10:13 AM, Francis Moreau <francis.moro@gmail.com> wrote:
>> Hello,
>>
>> Is it possible to keep submodules notes in the super project  ?
>
> Not easily. I guess it depends on what you want to use the notes for.
> In order for notes to be generally useful (i.e. show up in logs,
> surviving a notes prune, etc.) they really must reside in the same
> repo as the annotated objects [1]. Now, if all your interaction with
> notes happens through scripts that you control, then I guess it would
> be possible to hack this in some sort of semi-workable way, but you
> would still have to make sure never to run "git notes prune" in the
> super project. I guess the real question here is: Why would you want
> to do this? and is there maybe some other way your use case can be
> accomodated?
>

Well, I'm tracking different foreign git repositories as submodules.
Those repositories which tracks different projects are not mine
therefore I can't save my own stuff directly in them. I need to
annotate some commits in each submodule.

One option would be to clone each repository in my own place, but I
though it would be simpler if I could store the anntotion in _my_
super project.

Thanks for your time.
-- 
Francis

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

* Re: Notes and submodules
  2013-08-20  8:39   ` Francis Moreau
@ 2013-08-20  9:41     ` Johan Herland
  0 siblings, 0 replies; 4+ messages in thread
From: Johan Herland @ 2013-08-20  9:41 UTC (permalink / raw)
  To: Francis Moreau; +Cc: git@vger.kernel.org

On Tue, Aug 20, 2013 at 10:39 AM, Francis Moreau <francis.moro@gmail.com> wrote:
>> On Mon, Aug 19, 2013 at 3:55 PM, Johan Herland <johan@herland.net> wrote:
>> On Mon, Aug 19, 2013 at 10:13 AM, Francis Moreau <francis.moro@gmail.com> wrote:
>>> Is it possible to keep submodules notes in the super project  ?
>>
>> Not easily. I guess it depends on what you want to use the notes for.
>> In order for notes to be generally useful (i.e. show up in logs,
>> surviving a notes prune, etc.) they really must reside in the same
>> repo as the annotated objects [1]. Now, if all your interaction with
>> notes happens through scripts that you control, then I guess it would
>> be possible to hack this in some sort of semi-workable way, but you
>> would still have to make sure never to run "git notes prune" in the
>> super project. I guess the real question here is: Why would you want
>> to do this? and is there maybe some other way your use case can be
>> accomodated?
>
> Well, I'm tracking different foreign git repositories as submodules.
> Those repositories which tracks different projects are not mine
> therefore I can't save my own stuff directly in them.

Sure you can. It's your clone, you can store whatever you want in
there, regardless of whether you are allowed to push your additions
back to the foreign repo. You can always set up another remote repo
(e.g. on GitHub) where you can push your additions (whether they be
notes or other Git objects).

> I need to
> annotate some commits in each submodule.
>
> One option would be to clone each repository in my own place, but I
> though it would be simpler if I could store the anntotion in _my_
> super project.

No, it's probably much more straightforward to simply maintain your
own clones/forks of each submodule, and keep the annotations directly
in there.

In Git, there is no real concept of _ownership_ of a project. I might
put a repo on a server somewhere, and I can "own" that repo in that I
control who is allowed to push into it, but anybody that can read that
repo, can also clone it, and I have no say in what happens inside
those clones. If somebody is not happy with how I control/maintain the
project, they can make their own clone/fork available online, and
convince everybody to use that repo (instead of my repo) as the
authoritative source of the project.

...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

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

end of thread, other threads:[~2013-08-20  9:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-19  8:13 Notes and submodules Francis Moreau
2013-08-19 13:55 ` Johan Herland
2013-08-20  8:39   ` Francis Moreau
2013-08-20  9:41     ` Johan Herland

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).