Re: Git archiving only branch work
- From
Peter Krefting <peter@softwolves.pp.se>
- Date
- Nov 13, 2014, 13:19 UTC
- Message-ID
- <alpine.DEB.2.02.1411131416010.8007@perkele.intern.softwolves.pp.se>
- In-Reply-To
- <5464a4e8.4a0.2bfa0e00.3067f800@geldenhuys.co.uk>
Graeme Geldenhuys:
> This works very well. The only problem we have so far is that if we have > files with spaces in the name (eg: SQL update scripts), then the command > breaks.
If you add -z to the git diff command-line, it will give you the names with nul terminators instead. If you couple that with xargs -0, you should be able to do something like this (untested):
deply = !sh -c 'git diff --name-only -z -D $2 | xargs -x -0 git archive --prefix=$1/ -o deploy_$1.zip HEAD'
-- \\// Peter - http://www.softwolves.pp.se/