You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

The biggest issues for projects wishing to include the public Daffodil git repository in their project is that if commits are made in the daffodil submodule and then your parent project pushes a state with Daffodil subproject checked in but not pushed you will create a state in the parent project that cannot be resolved because in this form Daffodil is configured with a detached HEAD so when you check in the parent, you're checking in the specific revision that Daffodil is in with your superproject.  If the superproject is then pushed but the changes in Daffodil are not pushed, anyone subsequently pulling the superproject will get an error when they try to update the subproject because it'll refer to an unpushed git id for Daffodil (since it hasn't been pushed to a public repository) and thus cannot be updated.

This is exhibited by the following example:

$ git clone http://me@mydomain.com/parent.git parent
Cloning into 'parent'...
remote: Counting objects: 317, done.
remote: Compressing objects: 100% (128/128), done.
remote: Total 317 (delta 64), reused 128 (delta 32)
Receiving objects: 100% (317/317), 1.28 MiB | 1.00 MiB/s, done.
Resolving deltas: 100% (64/64), done.
$ cd parent
$ git submodule add https://opensource.ncsa.illinois.edu/fisheye/git/dfdl.git daffodil
Cloning into 'daffodil'...
remote: Counting objects: 13373, done.
remote: Compressing objects: 100% (6423/6423), done.
remote: Total 13373 (delta 7472), reused 9849 (delta 5406)
Receiving objects: 100% (13373/13373), 102.10 MiB | 4.03 MiB/s, done.
Resolving deltas: 100% (7472/7472), done.
$ cd daffodil

do some stuff

$ git commit -a -m "daffodil stuff"
[master 700dc40] daffodil stuff
 Committer: You <you@yourdomain.com>
1 file changed, 1 insertion(+)
$ cd ..

Make some changes to parent

$ git commit -a -m "stuff"
[master 317abcd] stuff
 Committer: You <you@yourdomain.com>
1 file changed, 1 insertion(+)
$ git push
Counting objects: 5, done.
Writing objects: 100% (3/3), 253 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
To http://me@mydomain.com/parent.git
 * [new branch] master -> master
Branch master set up to track remote branch master from origin.
$

Now when someone pulls the latest changes to  http://me@mydomain.com/parent.git and performs a merge from the newly pushed master they'll get a mismatch when you call:

$ git submodule update
fatal: reference isn’t a tree: 6c5e70b984a60b3cecd395edd5b48a7575bf58e0
Unable to checkout '6c5e70b984a60b3cecd395edd5ba7575bf58e0' in submodule path 'daffodil'

Therefore, if you want to import Daffodil as a git submodule you'll have to treat the Daffodil repository as read-only in order to avoid uploading unpushed git states for Daffodil in your project.

  • No labels