Kentzo / git-archive-all

A python script wrapper for git-archive that archives a git superproject and its submodules, if it has any. Takes into account .gitattributes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for exporting only init'ed submodules

akien-mga opened this issue · comments

My use case involves exporting a Git repository with only a subset of its submodules initialized and updated, as shown here:

$ git submodule 
 f60be494a43a49fd7ff61603e132c1e24c160d88 assets/lang (f60be49)
-7751cf73f5c06f1be21f5f31c3e2d9a7bacd3a93 dx9sdk
 be7425ef70231ab82930331959ab487d605d0482 ext/SPIRV-Cross (2018-08-07~7)
 9efe3367284d2d1eeb14fc302a2c12c36e3e255e ext/armips (v0.9-128-g9efe336)
 3d3ae7129d17643bc706da0a2eea85aafd10ab3a ext/discord-rpc (v3.1.0-20-g3d3ae71)
 29619b2312f7bc862221749f3f4d37c3e6a0dee2 ext/glslang (2.3-2139-g29619b23)
-73063f5002612c6bf64fe24f851cd5cc0d83eef9 ext/rapidjson
-7472c903ec771c00af9925097e8d37075e9a379f ffmpeg
-d02ba7407050f445edf9e908374ad4bf3b2f237b pspautotests

It used to work fine in the past with git-archive-all, but now I'm getting this kind of error:

$ git archive-all --prefix=ppsspp-1.7.2/ ../SOURCES/ppsspp-1.7.2.tar.xz
[Errno 2] No such file or directory: '/home/akien/Mageia/Checkout/ppsspp/ppsspp/pspautotests/pspautotests'

I initially thought that it would be a git-archive-all regression and went back to older versions to test (down to 1.15), but all versions give me the same output.

I suspect this might be due to a change in Git itself (I'm running Git 2.19.1 now, but last time I used this workflow successfully I was on 2.13.x).

It used to work fine so IMO it could be handled as a bug in git-archive-all that it no longer works, but I'm fine with it being treated as a feature request to add a --ignore-unitialized switch or similar to enable this workflow. Thanks!

What if in addition to --extra there will be an --exclude option?

That would work for me too.

Added both options, so you should be able to exclude the submodules either way. Please try both of them and let me know if it works for your use-case.