Re: [RFC] Submodules in GIT

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andy Parkins <andyparkins@...>
Cc: <git@...>
Date: Thursday, November 30, 2006 - 12:05 pm

Andy Parkins wrote:

Right now you only have commits of the top directory aka the super 
project. Every subdirectory is just that: a directory (which git stores 
as trees).

Now, if you have a subdirectory that git stores as a commit, not a tree, 
you have a subproject. It is a directory with history, and because the 
commit is part of your superprject, you have access to this history.


No, it is not. Currently, there is no way to store a commit within the 
contents of another commit. You can only store trees and blobs.


OK.


OK, I am still with you so far.


Here comes the part where we did not meet before.

Of course you do not make any reference from your subproject to your 
superproject. You do exactly what you do in git today when you work with 
different branches:

Step 1: You fix a bug in myproject's subdirectory libxcb.

Step 2: You commit to myproject. myproject now contains a new commit 
object in path libxcb. (How to do that is up to the UI but at the 
repository level the outcome should be obvious). This commit is local to 
your repository.

Step 3: You propose your changes to the libxcb upstream (it might not be 
a repository you have write access to). I use the following made up 
syntax (see man git-rev-parse):

A suffix : followed by a path, _followed by a suffix //::_ names the 
_revision_ at the given path in the tree-ish object named by the part 
before the colon.

Step 3a: Generate a patch

git diff libxcb//^..libxcb//

Step 3b: Push your changes

git push <libxcb-repository> HEAD:libxcb//:<branch in libxcb-repository>

Step 3c: Let your changes be pulled

"Hello, please pull <myproject-repository> HEAD:libxcb//:<branch in 
libxcb-repository>"

Step 4: Pull upstream version (hopefully with your changes, otherwise 
you have to merge)

git pull <libxcb-repository> <branch in libxcb-repository>::HEAD:libxcb//

See, it works.

 From what I understand you want to do the commit and push steps in one 
go. How do you want to record local (to your superproject) changes to 
the subproject?

Regards

Stephan
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [RFC] Submodules in GIT, Stephan Feder, (Thu Nov 30, 10:00 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Thu Nov 30, 10:49 am)
Re: [RFC] Submodules in GIT, sf, (Thu Nov 30, 12:05 pm)
Re: [RFC] Submodules in GIT, Andy Parkins, (Fri Dec 1, 5:19 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 5:57 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Fri Dec 1, 6:29 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 7:31 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Fri Dec 1, 8:20 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 8:37 am)
Re: [RFC] Submodules in GIT, Sven Verdoolaege, (Fri Dec 1, 6:42 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Fri Dec 1, 7:02 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 7:46 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Fri Dec 1, 8:16 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 8:34 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Fri Dec 1, 9:59 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 10:07 am)
Re: [RFC] Submodules in GIT, Sven Verdoolaege, (Fri Dec 1, 7:10 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Fri Dec 1, 8:12 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 8:28 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Fri Dec 1, 10:11 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 11:12 am)
Re: [RFC] Submodules in GIT, sf, (Fri Dec 1, 7:45 am)
Re: [RFC] Submodules in GIT, sf, (Thu Nov 30, 12:12 pm)
Re: [RFC] Submodules in GIT, Sven Verdoolaege, (Thu Nov 30, 11:20 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Thu Nov 30, 11:30 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Thu Nov 30, 1:19 pm)
Re: [RFC] Submodules in GIT, Sven Verdoolaege, (Thu Nov 30, 12:33 pm)
Re: [RFC] Submodules in GIT, Andy Parkins, (Thu Nov 30, 8:01 pm)
Re: [RFC] Submodules in GIT, Sven Verdoolaege, (Fri Dec 1, 5:32 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Fri Dec 1, 6:19 am)
Re: [RFC] Submodules in GIT, Andreas Ericsson, (Thu Nov 30, 11:50 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Thu Nov 30, 12:08 pm)