From: Linus Torvalds <torvalds@osdl.org>
To: Simon Richter <Simon.Richter@hogyros.de>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>, git@vger.kernel.org
Subject: Re: RFC: Subprojects
Date: Wed, 11 Jan 2006 09:42:44 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.64.0601110928350.5073@g5.osdl.org> (raw)
In-Reply-To: <43C537C9.4090206@hogyros.de>
On Wed, 11 Jan 2006, Simon Richter wrote:
>
> The important thing for me is that I need to be able to transfer them easily,
> or turn a subdirectory into a subproject or vice versa.
Turning a _snapshot_ of a subproject into a subdirectory is easy: you can
literally just create a subdirectory, copy it there, and it will re-use
all the objects that the subproject uses (ie the top-level project will
have a "tree" entry that just points to the same tree entry as the
top-level commit in the sub-project).
However, while that works as a way to import snapshots, it doesn't work in
any other way. It allows you to share objects with the "real project", and
it's space-efficient etc, but there's no shared history, and you cannot
merge back-and-forth, which is probably what you really want to do.
Quite frankly, you really probably want more of a "git-aware symlink" kind
of thing. I'd really hesitate (in fact, I'd object) to re-use the existing
"tree" type for it, but you're not the only one to have asked for
subproject support, so this is clearly not a odd request.
> > Sorry, we discussed similar things already. It is not necessary to change
> > the structure. Even more: it makes no sense. Why would you want to have two
> > or more commit messages for the same revision?
>
> Because the commit affects both the subproject and the master project.
What we _could_ do is for you to first do a commit in the "independent"
subproject (it really would be a totally independent git repository in all
ways: you could continue to merge it with other subprojects of the same
type), and then you could commit a new pointer to that subproject in the
master project.
The two would really be fundamentally independent: they'd be two different
git projects, one would just have a strange kind of "symlink" to the
other, which would include a name and the top commit SHA1 of the other
project.
Getting everything to work reasonably seamlessly would be potentially
painful (getting "git diff" to recurse into the subdirectory correctly is
non-trivial: you'd have a separate ".git/index" file for it), but it
sounds doable.
I'd suggest adding a new kind of object ("gitlink") which has some
well-specified format (20-byte SHA1 + ASCII C string "name" - the name
translation to external repository would be done in the .git/config file
of the "outer" project). Then a special file mode to indicate that in the
"struct tree", and support for "git-update-cache" to understand how such
an object is really tied into the "<pathname>/.git/HEAD" file rather than
the rest of the directory contents.
Then a "git fetch" would have to be taught to recursively fetch the other
subproject when the "gitlink" changes.
It should be doable: somebody could try to implement a rough first draft
(maybe not very seamless at first).
Linus
next prev parent reply other threads:[~2006-01-11 17:43 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-11 15:58 RFC: Subprojects Simon Richter
2006-01-11 16:44 ` Johannes Schindelin
2006-01-11 16:52 ` Simon Richter
2006-01-11 17:42 ` Linus Torvalds [this message]
2006-01-11 19:43 ` Simon Richter
2006-01-11 20:06 ` Linus Torvalds
2006-01-14 8:59 ` Junio C Hamano
2006-01-14 19:16 ` Linus Torvalds
2006-01-14 19:32 ` A Large Angry SCM
2006-01-14 20:02 ` Linus Torvalds
2006-01-14 20:30 ` A Large Angry SCM
2006-01-14 20:38 ` Junio C Hamano
2006-01-15 0:28 ` Martin Langhoff
2006-01-15 0:49 ` Junio C Hamano
2006-01-15 1:55 ` Tom Prince
2006-01-16 5:06 ` Daniel Barkalow
2006-01-16 19:08 ` A Large Angry SCM
2006-01-16 20:20 ` Daniel Barkalow
2006-01-16 22:25 ` A Large Angry SCM
2006-01-16 7:48 ` Alex Riesen
2006-01-14 20:16 ` Junio C Hamano
2006-01-15 1:01 ` Junio C Hamano
2006-01-16 10:44 ` Josef Weidendorfer
2006-01-16 20:49 ` Junio C Hamano
2006-01-17 5:46 ` Daniel Barkalow
2006-01-17 6:18 ` Junio C Hamano
2006-01-17 14:09 ` Petr Baudis
2006-01-17 16:45 ` Daniel Barkalow
2006-01-17 17:33 ` Craig Schlenter
2006-01-17 17:38 ` Linus Torvalds
2006-01-17 17:41 ` Daniel Barkalow
2006-01-18 1:41 ` Junio C Hamano
2006-01-18 3:49 ` Junio C Hamano
2006-01-18 11:47 ` Alexander Litvinov
2006-01-18 13:29 ` Andreas Ericsson
2006-01-18 17:06 ` Junio C Hamano
2006-01-18 18:21 ` Daniel Barkalow
2006-01-18 18:49 ` Junio C Hamano
2006-01-18 19:29 ` Daniel Barkalow
2006-01-23 1:22 ` Petr Baudis
2006-01-23 0:50 ` Petr Baudis
2006-01-16 7:28 ` Alexander Litvinov
2006-01-16 10:16 ` Andreas Ericsson
2006-02-20 13:16 ` Uwe Zeisberger
2006-02-21 7:57 ` Junio C Hamano
2006-01-12 3:19 ` Alexander Litvinov
2006-01-12 4:46 ` Martin Langhoff
2006-01-12 5:25 ` Alexander Litvinov
2006-01-12 5:39 ` Martin Langhoff
2006-01-12 8:36 ` Alexander Litvinov
2006-01-12 8:58 ` Alex Riesen
2006-01-12 7:20 ` Anand Kumria
2006-01-12 13:38 ` Daniel Barkalow
2006-01-15 15:07 ` [RFC][PATCH] Cogito support for simple subprojects Petr Baudis
2006-01-15 17:38 ` Linus Torvalds
2006-01-15 19:15 ` Junio C Hamano
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0601110928350.5073@g5.osdl.org \
--to=torvalds@osdl.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=Simon.Richter@hogyros.de \
--cc=git@vger.kernel.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.
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 NNTP newsgroup(s).