gruntwork-io / git-xargs

git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.
https://blog.gruntwork.io/introducing-git-xargs-an-open-source-tool-to-update-multiple-github-repos-753f9f3675ec
Apache License 2.0
935 stars 62 forks source link

Allow reading repo names via stdin #16

Closed brikis98 closed 3 years ago

brikis98 commented 3 years ago

I was using git-xargs today and wanted to be able to pass in repo names via stdin, so I took a few minutes and implemented it. This fixes #8.

Other bonus tweaks:

  1. The order of preference for how to pass in repos is now: --github-org, --repos, --repo, stdin. My thinking was to go from easiest to hardest. Not super attached to this, so feedback welcome.
  2. Added stdin to README. Also added missing --repo option.
  3. Make getting started steps a bit shorter / more compact, so they are easier to follow.
  4. Remove unnecessary ./ from git-xargs examples in README.
  5. Show help text if you run git-xargs with no arguments at all.

Do we have an integration test that actually runs the git-xargs CLI? If so, I could add a test that passes in repos via stdin. But as it is, I don't see any easy way to test that?

zackproser commented 3 years ago

Fantastic. Thanks Jim. Will review / respond as soon as I'm back at my computer.

zackproser commented 3 years ago

I was using git-xargs today and wanted to be able to pass in repo names via stdin, so I took a few minutes and implemented it. This fixes #8.

Other bonus tweaks:

1. The order of preference for how to pass in repos is now: `--github-org`, `--repos`, `--repo`, `stdin`. My thinking was to go from easiest to hardest. Not super attached to this, so feedback welcome.

2. Added `stdin` to README. Also added missing `--repo` option.

3. Make getting started steps a bit shorter / more compact, so they are easier to follow.

4. Remove unnecessary `./` from `git-xargs` examples in README.

5. Show help text if you run `git-xargs` with no arguments at all.

This looks great - thanks Jim!

Do we have an integration test that actually runs the git-xargs CLI? If so, I could add a test that passes in repos via stdin. But as it is, I don't see any easy way to test that?

Not really. Initially I played around with that a bit but opted to drop it in favor of focusing on getting coverage for the functions themselves, figuring that urfave/cli is already itself tested, but agree it would be valuable to have some explicit tests against the git-xargs CLI itself given this new functionality.