GoogleCloudPlatform / GoogleCloudPlatform/gsutil

gsutil cp command flattens subdirectories when -j option provided

Open
#1,212 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
918
Forks
335
PR merge metrics
No merged PRs in 30d

Description

The `-r` option provided here preserves the nested folder structure under `somefolder/`.

```
gsutil -m cp -r somefolder/* gs://my-bucket
```

Providing an additional `-j` option breaks this behaviour and results in a flattened output.

```
gsutil -m cp -r -j somefolder/* gs://my-bucket
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two `gsutil -m cp -r` commands, comparing the output with and without `-j`. Trace the `cp` command's handling of recursive paths and parallel execution; done means the `-j` form preserves the nested structure under `somefolder/` just like the form without `-j`.

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
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.