GoogleCloudPlatform / GoogleCloudPlatform/gsutil
cat files | gsutil -m cp -r -I -c gs://bucket/initial/path/prefix/ -- upload truncates path
- Dominant language
- Python
- Stars
- 918
- Forks
- 335
- PR merge metrics
- No merged PRs in 30d
Description
`cat files | gsutil -m cp -r -I -c gs://bucket/initial/path/prefix/` where the files list is like:
```
woodstox/stax2/maven-metadata.xml.md5
woodstox/stax2/maven-metadata.xml.sha1
woodstox/stax2/2.1/stax2-2.1.jar.sha1
woodstox/stax2/2.1/maven-metadata.xml.md5
woodstox/stax2/2.1/maven-metadata.xml.sha1
woodstox/stax2/2.1/stax2-2.1.jar.md5
woodstox/wstx/src/wstx-src.tar.gz.md5
woodstox/wstx/src/wstx-src.tar.gz.sha1
woodstox/wstx/src/wstx-src.pom.sha1
woodstox/wstx/src/maven-metadata.xml.md5
woodstox/wstx/src/maven-metadata.xml.sha1
woodstox/wstx/src/wstx-src.zip.sha1
woodstox/wstx/src/wstx-src.zip.md5
```
gives me a bucket with:
```
initial/path/prefix/maven-metadata.xml.md5
initial/path/prefix/maven-metadata.xml.sha1
initial/path/prefix/stax2-2.1.jar.sha1
initial/path/prefix/maven-metadata.xml.md5
initial/path/prefix/maven-metadata.xml.sha1
initial/path/prefix/stax2-2.1.jar.md5
initial/path/prefix/wstx-src.tar.gz.md5
initial/path/prefix/wstx-src.tar.gz.sha1
initial/path/prefix/wstx-src.pom.sha1
initial/path/prefix/maven-metadata.xml.md5
initial/path/prefix/maven-metadata.xml.sha1
initial/path/prefix/wstx-src.zip.sha1
initial/path/prefix/wstx-src.zip.md5
```
This happens w/ and w/o the -r.
The whole reason I'm using -I is to get that path recorded. This doesn't seem right, but probably can't be fixed for compatibility reasons, any suggestions?
Contributor guide
Research direction
Start with the `gsutil -m cp -r -I -c` command path and trace how input filenames are converted into destination object names. Compare the reported flattened paths with the expected paths from the supplied file list, then inspect existing tests for `cp -I` behavior if available. Done means nested relative paths are preserved without changing established compatibility behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100