Reputation: 63
Anyone know what could cause this error?
I am trying to create a package on git using this command:
git diff -z --name-only --diff-filter=MAR 5e2a4b4 5261fe1 | xargs -s1000000 -0 git archive develop -o 'package.zip'
Upvotes: 4
Views: 1245
Reputation: 14880
Apart from getting the error on ssh, which you've already ruled out, it could also be that git archive can handle a limited number of argument on the command line.
You are already (suspiciously) limiting the total running length of the arguments with -s
, and you indicated your command is working for some commits but not the others. You could investigate the difference further by setting GIT_TRACE=1
.
Generally it is common to limit the number of arguments with xargs -n
in addition to -s
but beware as this will execute the command passed to xargs multiple times, when the number of arguments exceeds the -n
threshold, and git archive
doesn’t support appending to an archive. You will have to call a script instead, that can increment a running number for the zip archive suffix, rotate the zip filenames in some acceptable fashion, or explicitly merge the output zip files into a master zip file.
And if you are running on cygwin, EBADF
can also imply that the permission to one of the files to be archived was denied by the underlying OS.
Upvotes: 2