git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Support projects including other projects
@ 2005-05-12  4:23 Daniel Barkalow
  2005-05-12  4:52 ` Junio C Hamano
  0 siblings, 1 reply; 14+ messages in thread
From: Daniel Barkalow @ 2005-05-12  4:23 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Petr Baudis, Linus Torvalds

I've come up with a way to handle projects like cogito which are based on
other projects. I think that it actually solves the real problem with such
projects, and it is actually very simple.

The problem that such projects run into, especially while both the core
and the non-core projects are in a state of substantial flux and when the 
non-core developer(s) contribute needed changes to the core, is that the
two projects not only have to be tracked, they have to be kept in 
sync. That is, a particular version of cogito requires a particular
version of git. There is a bit of convenience to having the tools
magically do the right thing when you check out the child project, but the
thing that really requires tool support is that you need to be able to
find the version of git-pb which matches the version of cogito you're
trying to build (and you might be searching the history for where a bug
was introduced, so you may not be able to use the latest of either).

The solution is to add a header to commits: "include {hash}", which simply
says that the given hash, which is from the core project, is the commit
needed to build this commit of the non-core project. This comes from an
argument to commit-tree ("-I", perhaps), and the parsing code needs to
identify the reference so that fsck-cache stays happy.

Git doesn't do anything more; wrapping layers would be able to take care
of the rest. When the wrapping layer determines that you are checking out
a commit with an include header, it also checks out the included commit,
using a different index file. The core treats everything as if you had a
bunch of non-tracked files in the directory (those being the things in the
other project). When you commit, it first commits any includes (if
needed), identifies the resulting core head, and passes that to the
include for the final result.

It seems to me like this should work perfectly. The one weakness is that
it's quite annoying to do by hand, since you have to simultaneously track
two index files and remember to pass the argument to commit-tree each
time. (Also, it means that you'd ideally pull git-pb from the cogito
repository with a client that ignores things not reachable from your head,
although Petr could still just copy and prune to match the current
situation).

I've written up the git changes needed, if people are interested in the
patch.

	-Daniel
*This .sig left intentionally blank*


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

end of thread, other threads:[~2005-05-12 19:04 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-12  4:23 [RFC] Support projects including other projects Daniel Barkalow
2005-05-12  4:52 ` Junio C Hamano
2005-05-12  5:19   ` Daniel Barkalow
2005-05-12  5:37     ` Junio C Hamano
2005-05-12  6:04       ` Daniel Barkalow
2005-05-12  6:28         ` Junio C Hamano
2005-05-12 16:51           ` Daniel Barkalow
2005-05-12 17:24             ` David Lang
2005-05-12 18:47             ` Junio C Hamano
2005-05-12 19:12               ` Daniel Barkalow
2005-05-12  6:14       ` Junio C Hamano
2005-05-12  5:37     ` James Purser
2005-05-12  5:46       ` Daniel Barkalow
2005-05-12  6:33         ` James Purser

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).