2009/3/28 Bosko Ivanisevic <[email protected]>

>
> I think you will not be able make git to do it. Git tracks content not
> files and folders and it will not delete folder. You can use post-
> checkout hook to do that for you.
>
>
Yes, of course.  I have not used hooks previously.  For anyone that is
interested all I had to do is make a script
 called post-checkout in .git/hooks with the following contents.

#!/bin/sh
# remove vendor/rails directory if not specified in .gitmodules
if [ -d vendor/rails ]
then
  # vendor/rails exists
  if ! grep -s -q vendor/rails .gitmodules
  then
    # vendor/rails not in .gitmodules, remove vendor/rails
    rmdir vendor/rails
  fi
fi

Yes I know this could probably be done much more concisely, but it is only
the third script I have written so I like to keep it simple and with
comments so that I can understand it.

Colin

Regards,
> Bosko
>
> On Mar 28, 1:03 pm, Colin Law <[email protected]> wrote:
> > This is really a git question but the problem is with rails using git and
> > others may have come across the problem.
> >
> > I have a branch on my application's git repository with edge rails as a
> > subproject checked out into vendor/rails. this allows me to keep my
> > application edge-compliant by checking out the branch (which creates the
> > rails folder in vendor), pulling the latest edge rails and running my
> > tests.  This works fine.
> >
> > The problem comes when I checkout the master again (which does not have a
> > vendor/rails folder). Git removes the contents of vendor/rails but leaves
> an
> > empty rails folder. The application will not run, the empty rails folder
> > confuses it, so I have to manually delete the folder.  Obviously I can
> have
> > a simple script to solve the problem but I wonder if there is a way of
> > telling git to remove the empty folder. Or perhaps there is an
> alternative.
> > I have googled in vain.
> >
> > Any ideas?
> >
> > Colin
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to