git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
To: "Torgil Svensson" <torgil.svensson@gmail.com>
Cc: "R. Steve McKown" <rsmckown@yahoo.com>,
	"Linus Torvalds" <torvalds@osdl.org>,
	git@vger.kernel.org
Subject: Re: [RFC] Submodules in GIT
Date: Fri, 15 Dec 2006 22:42:49 +0100	[thread overview]
Message-ID: <200612152242.50472.Josef.Weidendorfer@gmx.de> (raw)
In-Reply-To: <e7bda7770612150943j71a7362bmb509cea3b7756003@mail.gmail.com>

On Friday 15 December 2006 18:43, Torgil Svensson wrote:
> On 12/15/06, Josef Weidendorfer <Josef.Weidendorfer@gmx.de> wrote:
> > However, there is nothing wrong with it. Yet, you perhaps want
> > the 2 Lib submodules not to go out of sync. This easily
> > can be done with symlinking the Lib checkouts. As they are submodules,
> > everything should work fine.
> 
> This is interesting. In my notation:
> 
> /path/to/link/name -> <commit>/path/to/subtree
> 
> means that there is a link named "name" in the tree object for
> "path/to/link". The link points to a "link object" specifying a
> subtree or blob of the tree that is pointed to in a submodule commit.

Ah, now I understand. I somehow missed this notation.

> This is not currently implemented but has at least the following
> advantages:
> 
> 1. You can access files in a submodule without fetching the whole
> submodule (which may be very large). (App1 is only interested in
> lib1.h, the rest is toally irrelevant)
> 2. Superproject can access referenced (linked) files in it's own
> folder-structure without being forced a structure by the subproject.

That all sounds fine, but how do you create such symlinks in practice?
Do you want to introduce special porcelain commands to create them?
Especially, what is the SCM user supposed to do to change the link
target, ie. from
 <commit>/path/to/subtree
to 
 <commit>/path2/to2/subtree2
?
Should this do a re-checkout at the other point?

By linking a file from a submodule, such a link seems to force that
this file has to be at a fixed position in the submodule. Otherwise,
some magic has to happen when the file is moved in the submodule,
possibly leading to a dangling link, eg. if the whole subdirectory
specified in the link is removed.

IMHO this is getting way to complex.
Much simpler is to include the full submodule at some path in
the supermodule, and create normal symlinks from the supermodule
into the submodule.

If you only want to check out part of a submodule, this should be
done with path-limiting checkouts, which should be a feature totally
independent from submodules.

And if you want to limit the number of objects transferred in cloning
of a subproject, it is better to further split this subproject into
multiple subprojects itself.
 
> If you do a symlink instead, doesn't you loose versioning information?

Of course, you need the submodule fully checked out somewhere in the
supermodule, and the link goes into the submodule directory. The
versioning is given by the supermodule/submodule link.

> What happens with the symlinks if someone clones the superproject?

As already said: the link has to go into a submodule directory, which
will be checked out automatically with the clone of the supermodule.

> > Perhaps an option you want to have is to force a checkout
> > of AppBuild to make these symlinking itself when it detects
> > identical submodules links.
> >
> > Hmmm... the only problem with a symlink is that it can go wrong
> > when moved. Unfortunately, I do not have a good solution for
> > this. We can not make UNIX symlinks smart in any way.
> > Hardlinking directories would be a solution, but that is not
> > possible.
> >
> 
> Wouldn't specifying the submodule path in the link object fit in well
> here? Then each "link object" can represent a checked out tree from
> the subproject in the superproject directory-structure.

The problem is not the representation in the git repository, but the
checked out module/submodule, where you need to use normal UNIX file semantics.
To move submodules around, the user should be able to just use
the normal UNIX "mv" commands, and git should be able to detect move
actions after the fact.
The simple thing here is that currently, git does not have this problem
as it tracks content, and does not even try to detect any moves at
commit time. This is different with submodules, as there, you want to
be able to track moves of any submodule root directories.

This now becomes a problem if you use symlinks to "unify" multiple checkouts
of the same submodule at multiple places in the supermodule, and move
the symlink around, as it easily can get dangling this way. Thus, you would
not have a way to see what submodule this link was talking about.

And for this thing, I do not see how your link object could help.

So it is better to use a simple submodule concept, and for this corner
cases, we perhaps could expect the user to fix e.g. a dangling symlink
to a previous submodule checkout himself, using a meaningful error message.

> > BTW, build project commits probably should not depend on any
> > history of other build commits.
> 
> Why? Can you give an example here.

If you have a source commit chain A => B => C => D, you want
to make any build commits totally independent: you first only
are interested in a build commit for source versions A and D,
and later find out that a build commit for B and C would be nice,
too. If you force build commits into some history order, this
order now would be A => D => B => C, which makes no sense.

Build commit independence can easily be achieved by making every commit
parentless, without further history. You still have the link
to the source version via the submodule link in the tree.
But to not loose any such build commits, they have to appear
as tags or refs (unless integrated in another superproject
build commit).


> > > Link: /headers/lib1.h -> <lib1-commit3>/src/lib1.h
> > > Link: /bin/lib1.so -> <build1-commit>/i386/lib1/lib1.so
> > > Link: /bin/app1 -> <build1-commit>/i386/app1/app1
> > >
> > >
> > > <lib1-commit1>, <lib1-commit2> and <lib1-commit3> should be the same,
> > > dictated by the app1 project.
> >
> > I do not see any problem here. Symlinks are stored in the git repository.
> > As the AppBuild commit depends on App and LibBuild submodule commits, the
> > symlinks always should be correct.
> 
> The main reason for these "links" are for versioning purposes: the
> uniqe SHA1 of the "link" representing a tree/blob in a version of the
> submodule should be "included" in the supermodules commit. Symlinks
> won't give that at all.

The version coupling will be there if the whole submodule is available
at some path in the supermodule checkout, as said above.


  reply	other threads:[~2006-12-15 21:43 UTC|newest]

Thread overview: 252+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-20 21:51 [RFC] Submodules in GIT Martin Waitz
2006-11-20 22:16 ` Jakub Narebski
2006-11-20 22:28   ` Martin Waitz
2006-11-20 22:43   ` Junio C Hamano
2006-11-20 23:02     ` Jakub Narebski
2006-11-20 23:52       ` Martin Waitz
2006-11-21  1:31       ` Sam Vilain
2006-11-20 23:05     ` Linus Torvalds
2006-11-20 23:25       ` J. Bruce Fields
2006-11-20 23:33         ` Martin Waitz
2006-11-21 18:01           ` J. Bruce Fields
2006-11-21 19:32             ` Martin Waitz
2006-11-20 23:29       ` Martin Waitz
2006-11-21  0:10       ` Junio C Hamano
2006-11-21  0:42         ` Jakub Narebski
2006-11-21  6:21           ` Martin Waitz
2006-11-21 10:04             ` Jakub Narebski
2006-11-21 11:49               ` Martin Waitz
2006-11-21  6:27         ` Martin Waitz
2006-11-21  7:36           ` Junio C Hamano
2006-11-21  7:55             ` Martin Waitz
2006-11-21 22:31       ` Yann Dirson
2006-11-21 22:51         ` Linus Torvalds
2006-11-21 22:59           ` Linus Torvalds
2006-11-21 23:54           ` Yann Dirson
2006-11-22  3:40             ` Shawn Pearce
2006-11-23 23:23               ` Yann Dirson
2006-11-25  6:53                 ` Shawn Pearce
2006-11-25 11:12                   ` Yann Dirson
2006-11-25 18:57                     ` Linus Torvalds
2006-11-25 19:19                       ` Steven Grimm
2006-11-25 19:30                         ` Linus Torvalds
2006-11-25 23:49                           ` Yann Dirson
2006-11-26  1:14                             ` Sven Verdoolaege
2006-11-26  1:32                               ` Yann Dirson
2006-11-26  3:39                             ` Linus Torvalds
2006-11-26  8:05                               ` Daniel Barkalow
2006-11-28  9:36                                 ` Andreas Ericsson
2006-11-28 10:29                                   ` Andy Parkins
2006-11-28 10:50                                     ` Jakub Narebski
2006-11-28 13:35                                       ` Andy Parkins
2006-11-28 15:44                                         ` Shawn Pearce
2006-11-28 16:29                                           ` Andy Parkins
2006-11-28 16:36                                             ` Shawn Pearce
2006-11-28 17:38                                             ` Jon Loeliger
2006-11-29 16:15                                             ` Martin Waitz
2006-11-30 11:57                                             ` sf
     [not found]                                               ` <200611301255.41733.andyparkins@gmail.com>
2006-11-30 14:00                                                 ` Stephan Feder
2006-11-30 14:49                                                   ` Andy Parkins
2006-11-30 15:20                                                     ` Sven Verdoolaege
2006-11-30 15:30                                                       ` Andy Parkins
2006-11-30 15:50                                                         ` Andreas Ericsson
2006-11-30 16:08                                                           ` Andy Parkins
2006-11-30 16:33                                                         ` Sven Verdoolaege
2006-12-01  0:01                                                           ` Andy Parkins
2006-12-01  0:11                                                             ` Jakub Narebski
2006-12-01  9:32                                                             ` Sven Verdoolaege
2006-12-01 10:19                                                               ` Andy Parkins
2006-11-30 17:19                                                         ` Martin Waitz
2006-11-30 16:05                                                     ` sf
2006-11-30 16:12                                                       ` sf
2006-12-01  9:19                                                       ` Andy Parkins
2006-12-01  9:57                                                         ` Martin Waitz
2006-12-01 10:29                                                           ` Andy Parkins
2006-12-01 10:42                                                             ` Sven Verdoolaege
2006-12-01 11:02                                                               ` Andy Parkins
2006-12-01 11:10                                                                 ` Sven Verdoolaege
2006-12-01 11:45                                                                   ` sf
2006-12-01 12:12                                                                   ` Andy Parkins
2006-12-01 12:28                                                                     ` Martin Waitz
2006-12-01 14:11                                                                       ` Andy Parkins
2006-12-01 15:12                                                                         ` Martin Waitz
2006-12-01 11:46                                                                 ` Martin Waitz
2006-12-01 12:16                                                                   ` Andy Parkins
2006-12-01 12:34                                                                     ` Martin Waitz
2006-12-01 13:59                                                                       ` Andy Parkins
2006-12-01 14:07                                                                         ` Martin Waitz
2006-12-01 11:31                                                             ` Martin Waitz
2006-12-01 12:20                                                               ` Andy Parkins
2006-12-01 12:37                                                                 ` Martin Waitz
2006-12-02 15:16                                                                   ` Jakub Narebski
2006-11-28 19:58                                         ` Steven Grimm
2006-11-28 21:02                                           ` Shawn Pearce
2006-11-29 16:03                                         ` Martin Waitz
2006-11-29 20:00                                           ` Andy Parkins
2006-11-30 12:16                                             ` Andreas Ericsson
2006-11-30 12:40                                               ` Andy Parkins
2006-11-30 17:06                                             ` Martin Waitz
2006-11-30 18:57                                               ` Andreas Ericsson
2006-12-01  8:49                                                 ` Andy Parkins
2006-12-01  9:33                                                   ` Andreas Ericsson
2006-12-01 10:38                                                     ` Andy Parkins
2006-12-01 12:03                                                 ` sf
2006-12-01 12:11                                                   ` Martin Waitz
2006-12-01 13:21                                                     ` sf
2006-12-01 13:43                                                       ` Martin Waitz
2006-12-01 14:23                                                         ` Stephan Feder
2006-12-01 15:07                                                           ` Martin Waitz
2006-12-01 16:04                                                             ` Stephan Feder
2006-12-01 16:15                                                               ` Martin Waitz
2006-12-05  9:01                                                 ` Uwe Kleine-Koenig
2006-12-05 10:33                                                   ` Andreas Ericsson
2006-12-05 11:11                                                     ` Jakub Narebski
2006-12-05 15:02                                                     ` Uwe Kleine-Koenig
2006-12-05 15:30                                                       ` Andreas Ericsson
2006-12-05 16:00                                                   ` Sven Verdoolaege
2006-12-01  9:02                                               ` Andy Parkins
2006-12-01 11:00                                                 ` Martin Waitz
2006-12-01 12:09                                                   ` sf
2006-12-01 12:12                                                     ` Martin Waitz
2006-12-01 13:05                                                       ` sf
2006-12-01 13:35                                                         ` Martin Waitz
2006-12-01 13:43                                                           ` Andreas Ericsson
2006-12-01 13:46                                                             ` Martin Waitz
2006-12-01 14:52                                                               ` Andreas Ericsson
2006-12-01 15:00                                                                 ` Martin Waitz
2006-12-01 16:38                                                                   ` Andreas Ericsson
2006-12-01 16:49                                                                     ` Linus Torvalds
2006-12-01 17:08                                                                       ` sf
2006-12-01 18:06                                                                         ` Andreas Ericsson
2006-12-01 20:13                                                                         ` Linus Torvalds
2006-12-01 20:30                                                                           ` Martin Waitz
2006-12-01 23:23                                                                             ` Alan Chandler
2006-12-01 22:06                                                                           ` Josef Weidendorfer
2006-12-01 22:12                                                                             ` Martin Waitz
2006-12-01 22:26                                                                               ` Josef Weidendorfer
2006-12-01 22:40                                                                                 ` Martin Waitz
2006-12-01 23:17                                                                               ` Josef Weidendorfer
2006-12-02 20:24                                                                                 ` Martin Waitz
2006-12-03  0:55                                                                                   ` Josef Weidendorfer
2006-12-03  6:29                                                                                     ` Martin Waitz
2006-12-01 22:26                                                                             ` Linus Torvalds
2006-12-01 22:41                                                                               ` sf
2006-12-01 23:03                                                                                 ` Josef Weidendorfer
2006-12-01 23:09                                                                                 ` Linus Torvalds
2006-12-01 23:36                                                                                   ` Josef Weidendorfer
2006-12-02  0:12                                                                                     ` Linus Torvalds
2006-12-02  9:22                                                                                       ` Andy Parkins
     [not found]                                                                                         ` <200612021255.59972.Josef.Weidendorfer@gmx.de>
2006-12-03  9:42                                                                                           ` Andy Parkins
2006-12-02 11:32                                                                                       ` Josef Weidendorfer
2006-12-02 19:52                                                                                         ` Linus Torvalds
2006-12-02 20:21                                                                                           ` Martin Waitz
2006-12-02 20:46                                                                                             ` Linus Torvalds
2006-12-02 20:58                                                                                               ` Martin Waitz
2006-12-03  1:11                                                                                                 ` Josef Weidendorfer
2006-12-02 20:18                                                                                       ` Martin Waitz
2006-12-02 20:44                                                                                         ` Linus Torvalds
2006-12-02 21:06                                                                                           ` Martin Waitz
2006-12-02 21:29                                                                                             ` Linus Torvalds
2006-12-02 21:22                                                                                           ` Linus Torvalds
2006-12-03  2:07                                                                                             ` Thoughts about memory requirements in traversals [Was: Re: [RFC] Submodules in GIT] Josef Weidendorfer
2006-12-03  2:25                                                                                               ` Linus Torvalds
2006-12-03  2:46                                                                                               ` Shawn Pearce
2006-12-03  3:21                                                                                                 ` Josef Weidendorfer
2006-12-03 11:10                                                                                                   ` Jakub Narebski
2006-12-03 11:47                                                                                                     ` Josef Weidendorfer
2006-12-03 20:46                                                                                           ` [RFC] Submodules in GIT Martin Waitz
2006-12-03 22:16                                                                                       ` Sven Verdoolaege
2006-12-03 22:32                                                                                         ` Linus Torvalds
2006-12-03 22:49                                                                                           ` Jakub Narebski
2006-12-04 11:12                                                                                           ` Josef Weidendorfer
2006-12-01 23:49                                                                                   ` sf
2006-12-02 18:57                                                                                     ` Torgil Svensson
2006-12-02 19:41                                                                                       ` Linus Torvalds
2006-12-03  9:19                                                                                         ` Torgil Svensson
2006-12-03 17:54                                                                                           ` Linus Torvalds
2006-12-04 20:26                                                                                             ` Torgil Svensson
2006-12-04 20:41                                                                                               ` Linus Torvalds
2006-12-04 21:36                                                                                                 ` Torgil Svensson
2006-12-05 10:42                                                                                                   ` Andreas Ericsson
2006-12-05 11:09                                                                                                     ` Jakub Narebski
2006-12-05 10:38                                                                                                 ` Andreas Ericsson
2006-12-05 11:01                                                                                                   ` Jakub Narebski
2006-12-03 19:33                                                                                         ` Andy Parkins
2006-12-05  2:33                                                                                         ` Daniel Barkalow
2006-12-05 22:07                                                                                           ` sf
2006-12-09 21:34                                                                                         ` R. Steve McKown
2006-12-10 11:47                                                                                           ` Torgil Svensson
2006-12-14 21:27                                                                                             ` Torgil Svensson
2006-12-14 23:07                                                                                               ` Josef Weidendorfer
2006-12-15 17:43                                                                                                 ` Torgil Svensson
2006-12-15 21:42                                                                                                   ` Josef Weidendorfer [this message]
2006-12-15 23:43                                                                                                     ` Torgil Svensson
2006-12-16  1:13                                                                                                       ` Torgil Svensson
2006-12-16  1:20                                                                                                         ` Torgil Svensson
2006-12-16  1:34                                                                                                           ` Jakub Narebski
2006-12-16  8:40                                                                                                             ` Torgil Svensson
2006-12-16  9:57                                                                                                               ` Jakub Narebski
2006-12-16 10:25                                                                                                                 ` Junio C Hamano
2006-12-16 15:05                                                                                                                 ` Torgil Svensson
2006-12-16 15:38                                                                                                                   ` Torgil Svensson
2006-12-16 16:32                                                                                                                   ` Jakub Narebski
2006-12-17  0:21                                                                                                                     ` Torgil Svensson
2006-12-16  1:49                                                                                                         ` Linus Torvalds
2006-12-16  2:12                                                                                                           ` Linus Torvalds
2006-12-16  8:50                                                                                                             ` Torgil Svensson
2006-12-02 20:12                                                                                   ` Martin Waitz
2006-12-01 22:55                                                                               ` Josef Weidendorfer
2006-12-01 23:07                                                                                 ` Martin Waitz
2006-12-01 23:30                                                                                 ` Linus Torvalds
2006-12-02  0:14                                                                                   ` Josef Weidendorfer
2006-12-02  0:33                                                                                     ` Linus Torvalds
2006-12-02  9:27                                                                                       ` Andy Parkins
2006-12-04 18:56                                                                                       ` Michael K. Edwards
2006-12-05  1:31                                                                                         ` Sam Vilain
2006-12-01 22:35                                                                           ` sf
2006-12-08 18:29                                                                           ` Jon Loeliger
2006-12-08 18:45                                                                             ` Sven Verdoolaege
2006-12-12  8:32                                                                             ` Andreas Ericsson
2006-12-01 17:14                                                                       ` Martin Waitz
2006-12-01 16:57                                                                     ` Martin Waitz
2006-12-01 18:08                                                                       ` Andreas Ericsson
2006-12-01 18:51                                                                         ` Martin Waitz
2006-12-01 13:51                                                           ` Stephan Feder
2006-12-01 14:58                                                             ` Martin Waitz
2006-12-01 15:47                                                               ` Stephan Feder
2006-12-01 16:54                                                                 ` Martin Waitz
2006-12-01 17:33                                                                   ` Stephan Feder
2006-12-01 18:48                                                                     ` Martin Waitz
2006-12-01 23:34                                                                       ` sf
2006-12-02 19:46                                                                         ` Martin Waitz
2006-12-01 19:17                                                                     ` Andy Parkins
2006-12-01 19:38                                                                       ` Martin Waitz
2006-12-01 21:04                                                                         ` Andy Parkins
2006-12-01 21:37                                                                           ` Martin Waitz
2006-12-01 21:54                                                                             ` Andy Parkins
2006-12-01 22:08                                                                               ` Martin Waitz
2006-12-02 10:04                                                                                 ` Andy Parkins
2006-12-02 13:50                                                                                   ` Josef Weidendorfer
2006-12-02 20:43                                                                                     ` Martin Waitz
2006-12-03  1:02                                                                                       ` Josef Weidendorfer
2006-12-02 20:40                                                                                   ` Martin Waitz
2006-12-02 13:14                                                                           ` Jakub Narebski
2006-12-02 13:08                                                                     ` Jakub Narebski
2006-12-02 12:48                                                   ` Jakub Narebski
2006-11-28 17:28                                   ` Daniel Barkalow
2006-11-28 18:08                                     ` Sven Verdoolaege
2006-11-28 18:37                                       ` Daniel Barkalow
2006-11-28 19:06                                         ` Sven Verdoolaege
2006-11-28 20:41                                           ` Daniel Barkalow
2006-11-28 21:10                                             ` Shawn Pearce
2006-11-28 21:32                                               ` Daniel Barkalow
2006-11-28 21:53                                                 ` Linus Torvalds
2006-11-20 22:49 ` Jakub Narebski
2006-11-21  7:21 ` Shawn Pearce
2006-11-22  5:29 ` Petr Baudis
2006-12-02 20:16 ` Jakub Narebski
2006-12-03  1:24   ` Robin Rosenberg
2006-12-03  1:31     ` Jakub Narebski
2006-12-03 12:22       ` Robin Rosenberg
2006-12-03 12:31         ` Jakub Narebski
2006-12-03 11:00     ` Jakub Narebski

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200612152242.50472.Josef.Weidendorfer@gmx.de \
    --to=josef.weidendorfer@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=rsmckown@yahoo.com \
    --cc=torgil.svensson@gmail.com \
    --cc=torvalds@osdl.org \
    /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.
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).