git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git submodule support feedback
@ 2007-04-26 11:38 Andy Parkins
  2007-04-26 11:56 ` Marco Costalba
  2007-04-26 21:28 ` Andy Parkins
  0 siblings, 2 replies; 7+ messages in thread
From: Andy Parkins @ 2007-04-26 11:38 UTC (permalink / raw)
  To: git

Hello,

I've started using submodule support in one of my projects.  I was previously 
using my own poorman's submodule support where I kept the commit in a 
file, .gitmodules.  Git's new submodule support is superior to this method 
and doesn't lose me any features over what I had so I thought I'd change.

My general comment is that it's great.  I've tried to trip it up a few times, 
but it works exactly as one would expect.  I was surprised how little I had 
to understand in order to make it work, I didn't even need git update-index.  
git-add and git-rm work fine when the directory you're adding is a git 
repository in itself.  Lovely.

I'll report further as I come across any stumbling blocks; but here is one to 
get you going: (It's not a problem with git really, and the workaround is 
simple, I'm reporting it for your information rather than to get it fixed).

In the master branch I deleted my .gitmodules file and did
 
 $ git add submodule
 $ git commit -m "Chuck poorman's-submodule use gitman's-submodule"

This took over the submodule management beautifully.  Now, I swapped to 
another branch and tried to merge the master branch:

 $ git checkout somebranch
 $ git merge master
 fatal: Updating 'submodule' would lose untracked files in it
 Merge with strategy recursive failed.

I appreciate why this has happened - submodule, from the point of view of 
git - doesn't exist in that branch, but the directory always has, as that's 
where I've kept it as my pseudo-submodule.  The fix was to do

 $ mv submodule submodule.tmp
 $ git merge master
 $ rmdir submodule
 $ mv submodule.tmp submodule

I bring this up only because anyone who's moving from non-submodule to 
submodule support might run into the same problem.

In short: great stuff - this is already more facility than I had, thanks 
chaps.



Andy
-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com

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

end of thread, other threads:[~2007-04-26 21:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-26 11:38 git submodule support feedback Andy Parkins
2007-04-26 11:56 ` Marco Costalba
2007-04-26 12:08   ` Andy Parkins
2007-04-26 21:28 ` Andy Parkins
2007-04-26 20:59   ` David Lang
2007-04-26 21:35   ` Junio C Hamano
2007-04-26 21:49     ` Andy Parkins

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