Jamis,

I agree it's better not to try to force something to be something else
that it's not.

However, I hope I haven't misled you. "Git archive" really does
function as an "export" option.  It turns out that the slowness I
experienced this morning was solely due to a stupid bash mistake I was
making. When used correctly, "git archive" appears to be a viable way
to export all or a subdirectory of a git repository. The fact that
github doesn't support it is the big problem.

With respect to the checkout strategy, it's still worth considering
adding :app_root and using "git filter-branch" solely for deploying a
subdirectory of a git repository.  This is something many people are
interested in doing and I think this approach will work for many of
them.

I created a branch in my fork of Capistrano named "app_root_checkout"
with just the checkout strategy changes:

  http://github.com/davidbody/capistrano/commits/app_root_checkout

If :app_root isn't set, the checkout strategy operates exactly as it
does now. If :app_root is set, the new checkout strategy will operate
as it does now, except that it runs "git filter-branch" to deploy just
the subdirectory specified in :app_root.

People who want to deploy a subdirectory and for whom this approach is
too slow can still write their own deployment recipe or reorganize
their repository.

--David


On Jan 24, 10:51 am, Jamis Buck <[email protected]> wrote:
> What this really says to me is two things:
>
> 1. There really is no "export" option in git, and the SCM::Git#export
> method in Capistrano should raise an exception instead of pretending to
> be something it isn't.
>
> 2. If you want to use git-filter-branch or git-archive to deploy your
> code, you should probably be looking at a specialized deployment
> strategy, and not trying to shoehorn the :export strategy.
>
> I'd rather not try to force this to be something it isn't.
>
> - Jamis
>
> On 1/24/09 9:37 AM, David W. Body wrote:
>
> > I take back what I said about "git archive" being more efficient than
> > "git filter-branch."  I've just been playing with these on a real
> > repository, and "git archive" is quite slow for me. I wish I could
> > remember what I did differently that made me think it was faster than
> > "git filter-branch."
>
> > There is an even bigger issue, though. Github apparently doesn't
> > support "git archive."  See
>
> >  http://groups.google.com/group/github/browse_thread/thread/cfcbcb1dc5...
>
> > --David
>
> > On Jan 22, 8:26 pm, "David W. Body" <[email protected]> wrote:
> >> Jamis,
>
> >> I've incorporated Bryan Cardillo's patch from
>
> >>  http://capistrano.lighthouseapp.com/projects/8716/tickets/65-git-expo...
>
> >> into the export method of git module, changing Bryan's :path variable
> >> to :app_root for consistency with my other changes. The result is on
> >> github at
>
> >>  http://github.com/davidbody/capistrano/tree/master
>
> >> Bryan's git archive approach is significantly more efficient than the
> >> git filter-branch approach I used in the checkout method.
>
> >> I originally thought about changing the checkout method to also use
> >> git archive, but I haven't done this because the RDoc on
> >> Capistrano::Deploy::SCM::Base#checkout says
>
> >> # Checkout a copy of the repository, at the given +revision+, to the
> >> # given +destination+. The checkout is suitable for doing development
> >> # work in, e.g. allowing subsequent commits and updates.
>
> >> I want to make sure the git checkout method is doing what it's
> >> supposed to do.  Thoughts?
>
> >> --David
>
> >> On Jan 19, 5:19 pm, "David W. Body" <[email protected]> wrote:
>
> >>> Jamis,
> >>> Git archive looks promising.  I'll take a look and let you know what I
> >>> find out.
> >>> --David
> >>> On Jan 19, 3:00 pm, Jamis Buck <[email protected]> wrote:
> >>>> David,
> >>>> Thanks for looking into this. Someone (I'm so bad, I can't even remember
> >>>> who it was, sorry!) recently posted another solution involving "git
> >>>> archive", which sounded like safe and efficient option for supporting
> >>>> this. Perhaps you could work your app_root option into the changes they
> >>>> proposed? They posted the patch to Capistrano's lighthouse:
> >>>>http://capistrano.lighthouseapp.com/projects/8716-capistrano/tickets
> >>>> - Jamis
> >>>> On 1/19/09 10:58 AM, David W. Body wrote:
> >>>>> Jamis and everyone,
> >>>>> Like several other Capistrano users, I've had a need to deploy
> >>>>> applications located in subdirectories of git repositories.  I've
> >>>>> tried several approaches, and none have been completely satisfactory.
> >>>>> The best solution I've come up with so far is to add an :app_root
> >>>>> variable to my recipe and set it to the subdirectory in my git
> >>>>> repository that I want to actually deploy. I set :app_root like this
> >>>>>   set :app_root, "my_app"
> >>>>> To make this work, I also modified Capistrano's git module so that it
> >>>>> executes the following command after cloning the repository:
> >>>>>   git filter-branch --subdirectory-filter my_app
> >>>>> I'm pretty new to git, so I don't know if this is the best solution.
> >>>>> I think running git filter-branch on a large repository is probably a
> >>>>> pretty expensive operation, but this approach seems to work OK for
> >>>>> smaller repositories.
> >>>>> [Note to other git newbies: If you want to try this command, only run
> >>>>> it on a clone of your repository. You'll be very unhappy with me (and
> >>>>> yourself) if you run it on your actual working repository.]
> >>>>> I just pushed these changes to a fork of Capistrano on github:
> >>>>>  http://github.com/davidbody/capistrano/tree/master
> >>>>> I'd appreciate feedback from anyone, especially from git experts.
> >>>>> --David W. Body / Big Creek Software, LLC
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to