#466912 git-buildpackage: allow to pass options to git-archive (such as --exclude=.gitignore) #466912
- Package:
- git-buildpackage
- Source:
- git-buildpackage
- Submitter:
- Yaroslav Halchenko
- Date:
- 2011-08-17 23:03:05 UTC
- Severity:
- wishlist
really sorry for me bugging your again... I hope that this one is not bogus git-archive takes care about excluding .git/ from the archive while generating .orig.tar.gz, but some times some other files better be excluded (like .gitignore). I understand that I could file a bugreport against git-archive but I think it is better to allow to add additional arguments to git-archive call (which later serve as args to tar call which is used as a back end) Thank you in advance!
Sounds reasonable. Care to send in a patch? -- Guido
might take me a while (too many things spin around) but ok...
git 1.6.0 has such a feature. You can use .gitattributes for that. Just add it to your git project directory: cat << EOF > .gitattributes .gitignore export-ignore .gitattributes export-ignore EOF
user pkg-fso-maint@lists.alioth.debian.org usertags 466912 + package-creation thanks Hi there! I would say that this is the wrong way to do that: - I do not want to specify stuff for each package I maintain with gbp. - is .gitattributes shipped with `git clone`? In that case, well, I do not want to modify upstream files... - what is the rationale to include .git* files in the .orig.tar.gz? I cannot find any, thus I expect the tool to create the archive does not take them into the account. Think about `dpkg-source -i` WRT CVS folder, for example. However, it seems that .gitattributes is the only way to specify files to be excluded from `git archive`: really, why the latter does not have any option to tar/zip? :-( BTW, the problem exists for .mailmap as well... Thx, bye, Gismo / Luca
Hm, maybe other people also want to build your package (backport for example). If they don't have that information then they will end up with a different package (even if it looks quite trivial at the moment). Yes, that is why it was added to export-ignore in my example. And yes, it isn't nice to change upstream files in this way. This is a good reason to introduce a feature for that to gbp. Don't understand what you mean. `git archive --format=tar` and `git archive -- format=zip`
Hi Robert.
I think what Luca meant was something like:
$ git archive --format=tar \
--archiver-options "--exclude-vcs --exclude=foo"
That is, giving options to tar. If that's not what was meant, that's
something I'd like to see.
Greetings.
On the other hand, as stated on: http://comments.gmane.org/gmane.comp.version-control.git/177092 It seems that this is impossible, since the tar command is not called. Greetings.