bash - Git issue - git archive handling files with space in their names -
i having trouble while handling filenames
having space in them.
i use below piece of script
fetch files contained in push onto
folder in zip
format , later unzip
files.
tempdir=$(mktemp -d /apps/sample/xxxx) while read oldrev newrev refname commits=`git rev-list $oldrev..$newrev` commit in $commits git diff-tree -z --no-commit-id --name-only -r $commit | xargs -0 git archive -o $tempdir/list.zip head: unzip $tempdir/list.zip -d $scandir rm -rf /apps/sample/list.zip done done exit 0
in below example, added , committed file sample file.txt
. thing when git archive
command encounters space, error below.
[root@inba2 repo]# git push origin master counting objects: 4, done. delta compression using 4 threads. compressing objects: 100% (2/2), done. writing objects: 100% (3/3), 296 bytes, done. total 3 (delta 1), reused 0 (delta 0) unpacking objects: 100% (3/3), done. remote: fatal: path not found: sample file.txt remote: archive: /apps/sample/l7im/list.zip remote: end-of-central-directory signature not found. either file not remote: zipfile, or constitutes 1 disk of multi-part archive. in remote: latter case central directory , zipfile comment found on remote: last disk(s) of archive. remote: unzip: cannot find zipfile directory in 1 of /apps/sample/l7im/list.zip or remote: /apps/sample/l7im/list.zip.zip, , cannot find /apps/sample/l7im/list.zip.zip, period
git version 1.7.1
bash version 4.1.2
help appreciated :)
Comments
Post a Comment