Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/gist-logs: Fix bug with parsing of command-line arguments #6936

Merged
merged 1 commit into from Jan 14, 2020

Conversation

@issyl0
Copy link
Member

issyl0 commented Jan 14, 2020

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew tests with your changes locally?

  • A user reported the following error when running brew gist-logs, reproducible with any formula:
$ brew gist-logs rustup-init
Error: undefined method `length' for nil:NilClass
Please report this bug:
  https://docs.brew.sh/Troubleshooting
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cmd/gist-logs.rb:145:in `gist_logs'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:102:in
  • From what I can tell, gist_logs_args.parse had ended up in the wrong method. The gistify_logs method already has formula (ie the formula name) passed into it. But it's the gist_logs method that needs to do the argument parsing. This was discovered by looking at some other recently changed ARGV => Homebrew.args code like cmd/info for inspiration.

  • Fixes #6933.

- A user reported the following error when running `brew gist-logs`,
reproducible with any formula:

```
$ brew gist-logs rustup-init
Error: undefined method `length' for nil:NilClass
Please report this bug:
  https://docs.brew.sh/Troubleshooting
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cmd/gist-logs.rb:145:in `gist_logs'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:102:in
```

- From what I can tell, `gist_logs_args.parse` had ended up in the wrong
  method. The `gistify_logs` method already has `formula` (ie the
  formula name) passed into it. But it's the `gist_logs` method that needs
  to do the argument parsing. This was discovered by looking at some other
  recently changed ARGV => Homebrew.args code like cmd/info.
@issyl0 issyl0 force-pushed the issyl0:fix-cmd-gist-logs-arg-parse-bug branch from d496912 to c65b3f3 Jan 14, 2020
@issyl0 issyl0 merged commit 5035485 into Homebrew:master Jan 14, 2020
3 checks passed
3 checks passed
tests (ubuntu-latest)
Details
tests (macOS-latest)
Details
coverage/coveralls First build on fix-cmd-gist-logs-arg-parse-bug at 73.793%
Details
@issyl0 issyl0 deleted the issyl0:fix-cmd-gist-logs-arg-parse-bug branch Jan 14, 2020
Copy link
Member

MikeMcQuaid left a comment

Nice work, thanks for the quick fix @issyl0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.