All of lore.kernel.org
 help / color / mirror / Atom feed
* git-archive ignores submodules
@ 2015-04-16 17:35 Pedro Rodrigues
  2015-04-16 17:56 ` Fredrik Gustafsson
  0 siblings, 1 reply; 7+ messages in thread
From: Pedro Rodrigues @ 2015-04-16 17:35 UTC (permalink / raw)
  To: git

I've been using git-archive as my main way of deploying to production
servers, but today I've come across a git repo with submodules and
found out that git archive has no option to include submodules on the
output archive.

This simply makes git-archive unusable on this scenario.

-- 
Pedro Rodrigues
+244 917 774 823
+351 969 042 335
Mail: prodrigues1990@gmail.com

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

* Re: git-archive ignores submodules
  2015-04-16 17:35 git-archive ignores submodules Pedro Rodrigues
@ 2015-04-16 17:56 ` Fredrik Gustafsson
  2015-04-16 18:09   ` Pedro Rodrigues
  0 siblings, 1 reply; 7+ messages in thread
From: Fredrik Gustafsson @ 2015-04-16 17:56 UTC (permalink / raw)
  To: Pedro Rodrigues; +Cc: git

On Thu, Apr 16, 2015 at 06:35:38PM +0100, Pedro Rodrigues wrote:
> I've been using git-archive as my main way of deploying to production
> servers, but today I've come across a git repo with submodules and
> found out that git archive has no option to include submodules on the
> output archive.

As far as I know this is an known limitation that's just waiting for
someone to solve. Thanks for bringing attention to it.

> This simply makes git-archive unusable on this scenario.

Not completely. There's a simple workaround. Combine git submodule
foreach with git archive and make an archive for each submodule.

Not as simple as if git archive --recurse-submodule would have been
implementet, but hopefully it can make things work for you at the
moment.

-- 
Fredrik Gustafsson

phone: +46 733-608274
e-mail: iveqy@iveqy.com
website: http://www.iveqy.com

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

* Re: git-archive ignores submodules
  2015-04-16 17:56 ` Fredrik Gustafsson
@ 2015-04-16 18:09   ` Pedro Rodrigues
  2015-04-16 19:03     ` Jens Lehmann
  0 siblings, 1 reply; 7+ messages in thread
From: Pedro Rodrigues @ 2015-04-16 18:09 UTC (permalink / raw)
  To: Fredrik Gustafsson; +Cc: git

Good to know about git submodule foreach.

Simpler yet, I'm using:

zip -r ../project.zip . -x *.git*

Which essentially does the same thing I would need from git-archive
--recurse-submodule, zip everything excluding .git folders. Still
would be better to use git itself.

2015-04-16 18:56 GMT+01:00 Fredrik Gustafsson <iveqy@iveqy.com>:
> On Thu, Apr 16, 2015 at 06:35:38PM +0100, Pedro Rodrigues wrote:
>> I've been using git-archive as my main way of deploying to production
>> servers, but today I've come across a git repo with submodules and
>> found out that git archive has no option to include submodules on the
>> output archive.
>
> As far as I know this is an known limitation that's just waiting for
> someone to solve. Thanks for bringing attention to it.
>
>> This simply makes git-archive unusable on this scenario.
>
> Not completely. There's a simple workaround. Combine git submodule
> foreach with git archive and make an archive for each submodule.
>
> Not as simple as if git archive --recurse-submodule would have been
> implementet, but hopefully it can make things work for you at the
> moment.
>
> --
> Fredrik Gustafsson
>
> phone: +46 733-608274
> e-mail: iveqy@iveqy.com
> website: http://www.iveqy.com



-- 
Pedro Rodrigues
+244 917 774 823
+351 969 042 335
Mail: prodrigues1990@gmail.com

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

* Re: git-archive ignores submodules
  2015-04-16 18:09   ` Pedro Rodrigues
@ 2015-04-16 19:03     ` Jens Lehmann
  2015-04-16 19:59       ` Pedro Rodrigues
  2015-04-19 16:19       ` Kevin Daudt
  0 siblings, 2 replies; 7+ messages in thread
From: Jens Lehmann @ 2015-04-16 19:03 UTC (permalink / raw)
  To: Pedro Rodrigues, Fredrik Gustafsson; +Cc: git, Johannes Schindelin

Am 16.04.2015 um 20:09 schrieb Pedro Rodrigues:
> Good to know about git submodule foreach.
>
> Simpler yet, I'm using:
>
> zip -r ../project.zip . -x *.git*
>
> Which essentially does the same thing I would need from git-archive
> --recurse-submodule, zip everything excluding .git folders. Still
> would be better to use git itself.

Yes.

> 2015-04-16 18:56 GMT+01:00 Fredrik Gustafsson <iveqy@iveqy.com>:
>> On Thu, Apr 16, 2015 at 06:35:38PM +0100, Pedro Rodrigues wrote:
>>> I've been using git-archive as my main way of deploying to production
>>> servers, but today I've come across a git repo with submodules and
>>> found out that git archive has no option to include submodules on the
>>> output archive.
>>
>> As far as I know this is an known limitation that's just waiting for
>> someone to solve. Thanks for bringing attention to it.

I just rebased a patch Lars Hjemli posted in 2009 (which I kept in my
GitHub repo to resurrect it when I find the time) to current master:

https://github.com/jlehmann/git-submod-enhancements/commits/archive--submodules

See gmane/$107030 for its original posting. Apart from renaming the
'--submodule' option to '--recurse-submodules' and solving a merge
conflict I didn't change anything. Not sure why it wasn't accepted
back then, I'll have to read that thread more closely ...

If people are interested I could try to polish it and resubmit it.
It would be great if Pedro could test that it does what he expects.

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

* Re: git-archive ignores submodules
  2015-04-16 19:03     ` Jens Lehmann
@ 2015-04-16 19:59       ` Pedro Rodrigues
  2015-04-20  8:51         ` Chris Packham
  2015-04-19 16:19       ` Kevin Daudt
  1 sibling, 1 reply; 7+ messages in thread
From: Pedro Rodrigues @ 2015-04-16 19:59 UTC (permalink / raw)
  To: Jens Lehmann; +Cc: Fredrik Gustafsson, git, Johannes Schindelin

I sure can. Just send me an ID I can pull and test in here (not really
into C, so this the least I can contribute).

Although, my expectations are very simple, I just expect(ed) the exact
same git-archive command to be run on submodule(s), and have an output
on a single zip|tar|whatever file.

Not completely off topic, but for consistency consider that:
git-clone supports --recursive and --recurse-submodules, which do the
same thing.
git-pull and git-push only support --recurse-submodules.

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

* Re: git-archive ignores submodules
  2015-04-16 19:03     ` Jens Lehmann
  2015-04-16 19:59       ` Pedro Rodrigues
@ 2015-04-19 16:19       ` Kevin Daudt
  1 sibling, 0 replies; 7+ messages in thread
From: Kevin Daudt @ 2015-04-19 16:19 UTC (permalink / raw)
  To: Jens Lehmann
  Cc: Pedro Rodrigues, Fredrik Gustafsson, git, Johannes Schindelin

On Thu, Apr 16, 2015 at 09:03:10PM +0200, Jens Lehmann wrote:
> Am 16.04.2015 um 20:09 schrieb Pedro Rodrigues:
> 
> If people are interested I could try to polish it and resubmit it.
> It would be great if Pedro could test that it does what he expects.

I'm certainly interested.

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

* Re: git-archive ignores submodules
  2015-04-16 19:59       ` Pedro Rodrigues
@ 2015-04-20  8:51         ` Chris Packham
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Packham @ 2015-04-20  8:51 UTC (permalink / raw)
  To: Pedro Rodrigues
  Cc: Jens Lehmann, Fredrik Gustafsson, GIT, Johannes Schindelin

On Fri, Apr 17, 2015 at 7:59 AM, Pedro Rodrigues
<prodrigues1990@gmail.com> wrote:
<snip>

> Not completely off topic, but for consistency consider that:
> git-clone supports --recursive and --recurse-submodules, which do the
> same thing.
> git-pull and git-push only support --recurse-submodules.

It took a while to get the terminology sorted but the eventual
agreement[1] was "--recurse-submodules" was the best generally
applicable flag for all commands. For backwards compatibility some
commands that already had "--recursive" as an option have retained it

--
[1] - http://article.gmane.org/gmane.comp.version-control.git/160634

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

end of thread, other threads:[~2015-04-20  8:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-16 17:35 git-archive ignores submodules Pedro Rodrigues
2015-04-16 17:56 ` Fredrik Gustafsson
2015-04-16 18:09   ` Pedro Rodrigues
2015-04-16 19:03     ` Jens Lehmann
2015-04-16 19:59       ` Pedro Rodrigues
2015-04-20  8:51         ` Chris Packham
2015-04-19 16:19       ` Kevin Daudt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.