Global --dry-run flag
Add a --dry-run flag that shows what the tool would do without actually doing it. No files are created, no repos are cloned, no remotes are added.
Born out of #34 where a dry run for --org was identified as important.
Supported commands
| Command |
Dry run output |
grab <url> |
Show the clone mode (worktree/standard), directory structure that would be created, and the clone command that would run |
grab --org <user> (#34) |
List the repos that would be cloned, their clone mode, and target paths |
grab -r <url/user> (#79) |
Show the remote name and URL that would be added to the current repo |
grab -R <url/user> (#79) |
Show the remotes that would be added to each repo across GRAB_PATH |
Usage
grab --dry-run git@github.com:User/repo.git
grab --dry-run --org boomatang
grab --dry-run -R Boomatang
grab --dry-run -r Boomatang
Flag interactions
--dry-run composes with all existing flags. The output reflects their effect:
grab --dry-run -s git@github.com:User/repo.git # shows standard clone instead of worktree
grab --dry-run -S --org boomatang # shows shallow clone for each repo
grab --dry-run --org boomatang --limit 5 --site github.com # shows the 5 repos that would be cloned from GitHub only
grab --dry-run -t git@github.com:User/repo.git # shows temp directory as target path
Output
The dry run shows both the action that would be taken and the commands that would run. For each repo it should indicate:
- Clone mode (worktree or standard)
- Target directory path
- Whether the path already exists (would be skipped)
- The git command that would run
Behaviour
- All output goes to stdout
- Exit code 0 on success
- Auth and API calls still happen where needed (e.g.
--org still queries the API to know what repos exist)
ls-remote calls still happen where needed (e.g. -R still verifies remote existence)
- Existing repos are reported as "would be skipped" rather than silently omitted
Global
--dry-runflagAdd a
--dry-runflag that shows what the tool would do without actually doing it. No files are created, no repos are cloned, no remotes are added.Born out of #34 where a dry run for
--orgwas identified as important.Supported commands
grab <url>grab --org <user>(#34)grab -r <url/user>(#79)grab -R <url/user>(#79)Usage
Flag interactions
--dry-runcomposes with all existing flags. The output reflects their effect:Output
The dry run shows both the action that would be taken and the commands that would run. For each repo it should indicate:
Behaviour
--orgstill queries the API to know what repos exist)ls-remotecalls still happen where needed (e.g.-Rstill verifies remote existence)